modify hash_string* code to use CRC32
[hiphop-php.git] / hphp / util / etch-helpers.h
blob5a65e9276ba634cfced65c4977de54b531292861
1 #ifndef incl_ETCH_HELPERS_H
2 #define incl_ETCH_HELPERS_H
4 #if defined(__CYGWIN__) || defined(__MINGW__) || defined(_MSC_VER)
5 #define CFI(x) .cfi_##x
6 #define CFI2(x, y) .cfi_##x y
7 #define CFI3C(x, y, z) .cfi_##x y##, z
8 #define ETCH_ALIGN16 .align 16
9 #define ETCH_ALIGN8 .align 8
10 #define ETCH_ALIGN4 .align 4
11 #define ETCH_SECTION(x) .section .text.x
12 #define ETCH_SIZE(x) /* Not used with PE/COFF on windows */
13 #define ETCH_NAME(x) x
14 #define ETCH_LABEL(x) .L##x
15 #elif defined(__APPLE__)
16 #define CFI(x) /* not used on OSX */
17 #define CFI2(x, y) /* not used on OSX */
18 #define CFI3C(x, y, z) /* not used on OSX */
19 #define ETCH_ALIGN16 .align 4 // on OSX this is 2^value
20 #define ETCH_ALIGN8 .align 3
21 #define ETCH_ALIGN4 .align 2
22 #define ETCH_SECTION(x) .text
23 #define ETCH_SIZE(x) /* not used on OSX */
24 #define ETCH_NAME(x) _##x
25 #define ETCH_LABEL(x) .L##_##x
26 #else
27 #define CFI(x) .cfi_##x
28 #define CFI2(x, y) .cfi_##x y
29 #define CFI3C(x, y, z) .cfi_##x y##, z
30 #define ETCH_ALIGN16 .align 16
31 #define ETCH_ALIGN8 .align 8
32 #define ETCH_ALIGN4 .align 4
33 #define ETCH_SECTION(x) .section .text.x
34 #define ETCH_SIZE(x) .size x, .-x
35 #define ETCH_NAME(x) x
36 #define ETCH_LABEL(x) .L##x
37 #endif
39 #endif // incl_ETCH_HELPERS_H