mirror of
https://github.com/darlinghq/darling.git
synced 2025-03-01 14:16:31 +00:00
156 lines
3.7 KiB
SQL
156 lines
3.7 KiB
SQL
// Copyright 2011 Shinichiro Hamaji. All rights reserved.
|
|
//
|
|
// Redistribution and use in source and binary forms, with or without
|
|
// modification, are permitted provided that the following conditions
|
|
// are met:
|
|
//
|
|
// 1. Redistributions of source code must retain the above copyright
|
|
// notice, this list of conditions and the following disclaimer.
|
|
//
|
|
// 2. Redistributions in binary form must reproduce the above
|
|
// copyright notice, this list of conditions and the following
|
|
// disclaimer in the documentation and/or other materials
|
|
// provided with the distribution.
|
|
//
|
|
// THIS SOFTWARE IS PROVIDED BY Shinichiro Hamaji ``AS IS'' AND ANY
|
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Shinichiro Hamaji OR
|
|
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
// SUCH DAMAGE.
|
|
|
|
// A translation table from Mac symbols to Linux's.
|
|
|
|
RENAME(__stderrp, __darwin_stderr)
|
|
RENAME(__stdoutp, __darwin_stdout)
|
|
RENAME(__stdinp, __darwin_stdin)
|
|
WRAP(stderr)
|
|
WRAP(stdout)
|
|
WRAP(stdin)
|
|
|
|
WRAP(fopen)
|
|
WRAP(fdopen)
|
|
WRAP(freopen)
|
|
WRAP(fclose)
|
|
WRAP(fread)
|
|
WRAP(fwrite)
|
|
WRAP(fseek)
|
|
WRAP(ftell)
|
|
WRAP(rewind)
|
|
WRAP(getc)
|
|
WRAP(fgetc)
|
|
WRAP(ungetc)
|
|
WRAP(fgets)
|
|
WRAP(putc)
|
|
WRAP(fputc)
|
|
WRAP(fputs)
|
|
WRAP(fscanf)
|
|
WRAP(vfscanf)
|
|
WRAP(fprintf)
|
|
WRAP(vfprintf)
|
|
WRAP(fflush)
|
|
WRAP(setbuf)
|
|
WRAP(setbuffer)
|
|
WRAP(ferror)
|
|
RENAME(_ferror, __darwin_ferror)
|
|
WRAP(fileno)
|
|
WRAP(tmpfile)
|
|
|
|
RENAME(__srget, __darwin_fgetc)
|
|
RENAME(__swbuf, __darwin_fputc)
|
|
|
|
RENAME(__toupper, toupper)
|
|
RENAME(__tolower, tolower)
|
|
|
|
RENAME(opendir$INODE64, opendir)
|
|
RENAME(readdir$INODE64, __darwin_readdir64)
|
|
WRAP(readdir)
|
|
|
|
WRAP(stat)
|
|
WRAP(fstat)
|
|
WRAP(lstat)
|
|
RENAME(stat$INODE64, __darwin_stat64)
|
|
RENAME(fstat$INODE64, __darwin_fstat64)
|
|
RENAME(lstat$INODE64, __darwin_lstat64)
|
|
|
|
WRAP(open)
|
|
|
|
WRAP(mmap)
|
|
WRAP(sysctl)
|
|
|
|
RENAME(realpath$DARWIN_EXTSN, realpath)
|
|
|
|
WRAP(execv)
|
|
WRAP(execvp)
|
|
WRAP(execl)
|
|
WRAP(execlp)
|
|
WRAP(execve)
|
|
WRAP(execle)
|
|
WRAP(posix_spawn)
|
|
WRAP(posix_spawnp)
|
|
|
|
WRAP(posix_spawn_file_actions_init)
|
|
WRAP(posix_spawn_file_actions_destroy)
|
|
WRAP(posix_spawn_file_actions_addopen)
|
|
WRAP(posix_spawn_file_actions_addclose)
|
|
WRAP(posix_spawn_file_actions_adddup2)
|
|
|
|
RENAME(CC_MD5_Init, MD5_Init)
|
|
RENAME(CC_MD5_Update, MD5_Update)
|
|
RENAME(CC_MD5_Final, MD5_Final)
|
|
RENAME(CC_MD5, MD5)
|
|
|
|
WRAP(__cxa_throw)
|
|
|
|
RENAME(atexit, __cxa_atexit)
|
|
|
|
WRAP(signal)
|
|
WRAP(sigaction)
|
|
WRAP(sigaltstack)
|
|
|
|
#ifdef __x86_64__
|
|
RENAME(__ashldi3, __ashlti3)
|
|
RENAME(__ashrdi3, __ashrti3)
|
|
RENAME(__cmpdi2, __cmpti2)
|
|
RENAME(__divdi3, __divti3)
|
|
RENAME(__fixdfdi, __fixdfti)
|
|
RENAME(__fixsfdi, __fixsfti)
|
|
RENAME(__floatdidf, __floattidf)
|
|
RENAME(__floatdisf, __floattisf)
|
|
RENAME(__lshrdi3, __lshrti3)
|
|
RENAME(__moddi3, __modti3)
|
|
RENAME(__udivdi3, __udivti3)
|
|
RENAME(__umoddi3, __umodti3)
|
|
#endif
|
|
|
|
// TODO(hamaji): *attr_gettype and *attr_getpshared
|
|
WRAP(pthread_mutexattr_settype)
|
|
WRAP(pthread_mutexattr_setpshared)
|
|
WRAP(pthread_rwlockattr_setpshared)
|
|
|
|
WRAP(dlopen)
|
|
WRAP(dlclose)
|
|
WRAP(dlerror)
|
|
WRAP(dlsym)
|
|
// TODO(hamaji): dladdr?
|
|
|
|
RENAME(_ZNSt12__basic_fileIcE8sys_openEP7__sFILESt13_Ios_Openmode,
|
|
_ZNSt12__basic_fileIcE8sys_openEP8_IO_FILESt13_Ios_Openmode)
|
|
|
|
WRAP(uname)
|
|
|
|
// TODO(hamaji): Not sure if this is right...
|
|
RENAME(select$1050, select)
|
|
|
|
WRAP(qsort_r)
|
|
|
|
WRAP(newlocale)
|
|
|
|
WRAP(compat_mode)
|