]> git.sesse.net Git - ffmpeg/blob - libpostproc/mangle.h
Original Commit: r26 | ods15 | 2006-09-22 14:18:22 +0300 (Fri, 22 Sep 2006) | 2 lines
[ffmpeg] / libpostproc / mangle.h
1 /*
2  * mangle.h - This file has some CPP macros to deal with different symbol
3  * mangling across binary formats.
4  *
5  * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef __MANGLE_H
23 #define __MANGLE_H
24
25 /* Feel free to add more to the list, eg. a.out IMO */
26 /* Use rip-relative addressing if compiling PIC code on x86-64. */
27 #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
28    (defined(__OpenBSD__) && !defined(__ELF__))
29 #if defined(ARCH_X86_64) && defined(PIC)
30 #define MANGLE(a) "_" #a"(%%rip)"
31 #else
32 #define MANGLE(a) "_" #a
33 #endif
34 #else
35 #if defined(ARCH_X86_64) && defined(PIC)
36 #define MANGLE(a) #a"(%%rip)"
37 #elif defined(CONFIG_DARWIN)
38 #define MANGLE(a) "_" #a
39 #else
40 #define MANGLE(a) #a
41 #endif
42 #endif
43
44 #endif /* !__MANGLE_H */
45