njn | 9a55ee8 | 2009-04-15 05:35:00 +0000 | [diff] [blame] | 1 | // 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. |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 8 | #if defined(VGO_darwin) |
| 9 | #define VG_SYM(x) "_"#x |
| 10 | #else |
njn | 9a55ee8 | 2009-04-15 05:35:00 +0000 | [diff] [blame] | 11 | #define VG_SYM(x) #x |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 12 | #endif |
njn | 9a55ee8 | 2009-04-15 05:35:00 +0000 | [diff] [blame] | 13 | |
| 14 | // This one is for use in asm files. |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 15 | #if defined(VGO_darwin) |
| 16 | #define VG_SYM_ASM(x) _##x |
| 17 | #else |
njn | 9c53325 | 2009-04-24 04:57:07 +0000 | [diff] [blame] | 18 | #define VG_SYM_ASM(x) x |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 19 | #endif |