blob: e2c2524ed3e66f953d45f7c859f16bb6bd938153 [file] [log] [blame]
njn9a55ee82009-04-15 05:35:00 +00001// Header to factor out platform differences in asm code.
2
3// On Darwin, all symbols get an underscore prepended when compiled. If we
4// use any such symbols in asm code, we need to add that underscore. So in
5// general, any symbol named in asm code should be wrapped by VG_SYM.
6
7// This one is for use in inline asm in C files.
njnf76d27a2009-05-28 01:53:07 +00008#if defined(VGO_darwin)
9#define VG_SYM(x) "_"#x
10#else
njn9a55ee82009-04-15 05:35:00 +000011#define VG_SYM(x) #x
njnf76d27a2009-05-28 01:53:07 +000012#endif
njn9a55ee82009-04-15 05:35:00 +000013
14// This one is for use in asm files.
njnf76d27a2009-05-28 01:53:07 +000015#if defined(VGO_darwin)
16#define VG_SYM_ASM(x) _##x
17#else
njn9c533252009-04-24 04:57:07 +000018#define VG_SYM_ASM(x) x
njnf76d27a2009-05-28 01:53:07 +000019#endif