1 /* feature.h - arch specific defines resulting from some tests */
4 #ifndef PARROT_FEATURE_H_GUARD
5 #define PARROT_FEATURE_H_GUARD
7 #perl - all below here gets evaled by perl, OUT is the filehandle
9 print OUT <<'END_PRINT';
11 /* from config/auto/memalign */
13 if (@memalign@ eq 'posix_memalign') {
14 print OUT <<'END_PRINT'
15 #define PARROT_HAS_POSIX_MEMALIGN
16 #define PARROT_HAS_SOME_MEMALIGN
19 elsif (@memalign@ eq 'memalign') {
20 print OUT <<'END_PRINT'
21 #define PARROT_HAS_MEMALIGN
22 #define PARROT_HAS_SOME_MEMALIGN
25 elsif (@memalign@ eq 'some_memalign') {
26 print OUT <<'END_PRINT'
27 #define PARROT_HAS_SOME_MEMALIGN
31 print OUT <<'END_PRINT';
33 /* from config/auto/isreg */
36 print OUT <<'END_PRINT';
37 #define PARROT_HAS_BROKEN_ISREG 1
41 print OUT <<'END_PRINT';
43 /* from config/auto/jit */
45 if ( @has_exec_protect@ )
47 print OUT <<'END_PRINT';
48 #define PARROT_HAS_EXEC_PROTECT
51 if (@jit_i386@ && @jit_i386@ eq 'fcomip') {
52 print OUT <<'END_PRINT';
54 # define PARROT_HAS_JIT_FCOMIP
59 my $va_result = @va_ptr_type@;
60 print OUT <<"END_PRINT";
62 /* from config/auto/va_ptr.pm: va_ptr_type => $va_result */
64 if (@va_ptr_type@ eq 'register') {
65 print OUT <<'END_PRINT';
66 /* if defined __powerpc__ || defined __x86_64__ || defined __s390__ */
67 # define PARROT_VA_TO_VAPTR(x) (x)
70 if (@va_ptr_type@ eq 'stack') {
71 print OUT <<'END_PRINT';
72 # define PARROT_VA_TO_VAPTR(x) (&(x))
76 print OUT <<'END_PRINT';
78 /* signal stuff from config/auto/signal */
81 if (@has_sigaction@) {
82 print OUT <<'END_PRINT';
83 #define PARROT_HAS_SIGACTION 1
86 if (@has___sighandler_t@) {
87 print OUT <<'END_PRINT';
88 #define PARROT_HAS___SIGHANDLER_T 1
91 if (@has_setitimer@) {
92 print OUT <<'END_PRINT';
93 #define PARROT_HAS_SETITIMER 1
94 #define PARROT_HAS_SOME_SYS_TIMER 1
98 print OUT <<'END_PRINT';
100 /* from config/auto/env */
103 print OUT <<'END_PRINT';
104 #define PARROT_HAS_SETENV 1
108 print OUT <<'END_PRINT';
109 #define PARROT_HAS_UNSETENV 1
113 print OUT <<'END_PRINT';
115 /* from config/auto/inline */
117 if (@inline@ ne '') {
119 print OUT <<"END_PRINT";
120 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
121 # define PARROT_INLINE inline
122 # define PARROT_HAS_INLINE
124 # define PARROT_INLINE
129 print OUT <<'END_PRINT';
130 #define PARROT_INLINE
134 my $has_socklen_t = @has_socklen_t@;
135 print OUT <<"END_PRINT";
137 /* from config/auto/socklen_t */
138 #define PARROT_HAS_SOCKLEN_T $has_socklen_t
141 print OUT <<'END_PRINT';
143 /* from config/auto/backtrace */
145 if (defined @backtrace@) {
146 print OUT <<"END_PRINT";
147 #define PARROT_HAS_BACKTRACE
148 #include <execinfo.h>
149 /* __USE_GNU seems to mess up stdio.h on Linux; only define it for dlfcn.h if
150 it's not already defined */
161 print OUT <<'END_PRINT';
163 /* from config/auto/neg_0 */
165 if (@has_negative_zero@) {
166 print OUT <<'END_PRINT';
167 #define PARROT_HAS_NEGATIVE_ZERO 1
171 print OUT <<'END_PRINT';
172 #undef PARROT_HAS_NEGATIVE_ZERO
176 print OUT <<'END_PRINT';
178 #endif /* PARROT_FEATURE_H_GUARD */
181 print OUT <<"END_PRINT";
185 * c-file-style: "parrot"
187 * vim: expandtab shiftwidth=4: