Skip to content
This repository
tree: b04ce3f711
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 195 lines (165 sloc) 3.718 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
/* feature.h - arch specific defines resulting from some tests */


#ifndef PARROT_FEATURE_H_GUARD
#define PARROT_FEATURE_H_GUARD

#perl - all below here gets evaled by perl, OUT is the filehandle

print OUT <<'END_PRINT';

/* from config/auto/memalign */
END_PRINT
if (@memalign@ eq 'posix_memalign') {
    print OUT <<'END_PRINT'
#define PARROT_HAS_POSIX_MEMALIGN
#define PARROT_HAS_SOME_MEMALIGN
END_PRINT
}
elsif (@memalign@ eq 'memalign') {
    print OUT <<'END_PRINT'
#define PARROT_HAS_MEMALIGN
#define PARROT_HAS_SOME_MEMALIGN
END_PRINT
}
elsif (@memalign@ eq 'some_memalign') {
    print OUT <<'END_PRINT'
#define PARROT_HAS_SOME_MEMALIGN
END_PRINT
}

print OUT <<'END_PRINT';

/* from config/auto/isreg */
END_PRINT
unless (@isreg@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS_BROKEN_ISREG 1
END_PRINT
}

print OUT <<'END_PRINT';

/* from config/auto/jit */
END_PRINT
if ( @has_exec_protect@ )
{
    print OUT <<'END_PRINT';
#define PARROT_HAS_EXEC_PROTECT
END_PRINT
}
if (@jit_i386@ && @jit_i386@ eq 'fcomip') {
    print OUT <<'END_PRINT';
#ifdef I386
# define PARROT_HAS_JIT_FCOMIP
#endif
END_PRINT
}

my $va_result = @va_ptr_type@;
print OUT <<"END_PRINT";

/* from config/auto/va_ptr.pm: va_ptr_type => $va_result */
END_PRINT
if (@va_ptr_type@ eq 'register') {
    print OUT <<'END_PRINT';
/* if defined __powerpc__ || defined __x86_64__ || defined __s390__ */
# define PARROT_VA_TO_VAPTR(x) (x)
END_PRINT
}
if (@va_ptr_type@ eq 'stack') {
    print OUT <<'END_PRINT';
# define PARROT_VA_TO_VAPTR(x) (&(x))
END_PRINT
}

my $va_ptr_floatval = @va_ptr_floatval@;
print OUT <<"END_PRINT";
# define PARROT_VA_PTR_FLOATVAL $va_ptr_floatval
END_PRINT

print OUT <<'END_PRINT';

/* signal stuff from config/auto/signal */
END_PRINT

if (@has_sigaction@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS_SIGACTION 1
END_PRINT
}
if (@has___sighandler_t@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS___SIGHANDLER_T 1
END_PRINT
}
if (@has_setitimer@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS_SETITIMER 1
#define PARROT_HAS_SOME_SYS_TIMER 1
END_PRINT
}

print OUT <<'END_PRINT';

/* from config/auto/env */
END_PRINT
if (@setenv@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS_SETENV 1
END_PRINT
}
if (@unsetenv@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS_UNSETENV 1
END_PRINT
}

print OUT <<'END_PRINT';

/* from config/auto/inline */
END_PRINT
if (@inline@ ne '') {
    my $inl = @inline@;
    print OUT <<"END_PRINT";
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
# define PARROT_INLINE inline
# define PARROT_HAS_INLINE
#else
# define PARROT_INLINE
#endif
END_PRINT
}
else {
    print OUT <<'END_PRINT';
#define PARROT_INLINE
END_PRINT
}

my $has_socklen_t = @has_socklen_t@;
    print OUT <<"END_PRINT";

/* from config/auto/socklen_t */
#define PARROT_HAS_SOCKLEN_T $has_socklen_t
END_PRINT

print OUT <<'END_PRINT';

/* from config/auto/backtrace */
END_PRINT
if (defined @backtrace@) {
    print OUT <<"END_PRINT";
#define PARROT_HAS_BACKTRACE
#include <execinfo.h>
/* __USE_GNU seems to mess up stdio.h on Linux; only define it for dlfcn.h if
it's not already defined */
#ifndef __USE_GNU
# define __USE_GNU
# include <dlfcn.h>
# undef __USE_GNU
#else
# include <dlfcn.h>
#endif
END_PRINT
}

print OUT <<'END_PRINT';

/* from config/auto/neg_0 */
END_PRINT
if (@has_negative_zero@) {
    print OUT <<'END_PRINT';
#define PARROT_HAS_NEGATIVE_ZERO 1
END_PRINT
}
else {
    print OUT <<'END_PRINT';
#undef PARROT_HAS_NEGATIVE_ZERO
END_PRINT
}

print OUT <<'END_PRINT';

#endif /* PARROT_FEATURE_H_GUARD */
END_PRINT

print OUT <<"END_PRINT";

/*
 * Local variables:
 * c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
END_PRINT
Something went wrong with that request. Please try again.