1 #ifndef MP_TARGET_H 2 #define MP_TARGET_H 3 4 5 /* 6 * mpatrol 7 * A library for controlling and tracing dynamic memory allocations. 8 * Copyright (C) 1997-2002 Graeme S. Roy <graeme.roy@analog.com> 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Library General Public 12 * License as published by the Free Software Foundation; either 13 * version 2 of the License, or (at your option) any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 * Library General Public License for more details. 19 * 20 * You should have received a copy of the GNU Library General Public 21 * License along with this library; if not, write to the Free 22 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 23 * MA 02111-1307, USA. 24 */ 25 26 27 /* 28 * Target definitions. These are automatically deduced from the 29 * preprocessor macros defined by the compiler on the host system, 30 * but they can also be overridden. 31 */ 32 33 34 /* 35 * $Id: target.h,v 1.38 2002/01/08 20:13:59 graeme Exp $ 36 */ 37 38 39 #ifdef HAVE_CONFIG_H 40 #include "configure.h" 41 #endif /* HAVE_CONFIG_H */ 42 43 44 /* The target operating system. This determines how the mpatrol library 45 * should interact with the underlying system, and how it should work around 46 * deficiencies in some operating systems. 47 */ 48 49 #define TARGET_ANY 0 /* no specific operating system */ 50 #define TARGET_UNIX 1 /* UNIX or UNIX-like */ 51 #define TARGET_AMIGA 2 /* Commodore AmigaOS */ 52 #define TARGET_WINDOWS 3 /* Microsoft Windows 95/98/ME/NT/2000 */ 53 #define TARGET_NETWARE 4 /* Novell Netware */ 54 55 56 #ifndef TARGET 57 #if defined(unix) || defined(_unix) || defined(__unix) || defined(__unix__) || \ 58 defined(AIX) || defined(_AIX) || defined(__AIX) || defined(__AIX__) || \ 59 defined(__Lynx) || defined(__Lynx__) 60 #define TARGET TARGET_UNIX 61 #elif defined(AMIGA) || defined(_AMIGA) || defined(__AMIGA) || \ 62 defined(__AMIGA__) 63 #define TARGET TARGET_AMIGA 64 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32) || \ 65 defined(__WIN32__) 66 #define TARGET TARGET_WINDOWS 67 #elif defined(NETWARE) || defined(_NETWARE) || defined(__NETWARE) || \ 68 defined(__NETWARE__) 69 #define TARGET TARGET_NETWARE 70 #else /* TARGET */ 71 #define TARGET TARGET_ANY 72 #endif /* TARGET */ 73 #endif /* TARGET */ 74 75 76 /* The string representation of the target operating system. 77 */ 78 79 #if TARGET == TARGET_UNIX 80 #define TARGET_STR "UNIX" 81 #elif TARGET == TARGET_AMIGA 82 #define TARGET_STR "Commodore AmigaOS" 83 #elif TARGET == TARGET_WINDOWS 84 #define TARGET_STR "Microsoft Windows 95/98/ME/NT/2000" 85 #elif TARGET == TARGET_NETWARE 86 #define TARGET_STR "Novell Netware" 87 #else /* TARGET */ 88 #define TARGET_STR "Unknown" 89 #endif /* TARGET */ 90 91 92 /* The UNIX system variant. This is only needed on UNIX systems due to the 93 * wide variety of vendors and their UNIX systems that support different 94 * features. 95 */ 96 97 #define SYSTEM_ANY 0 /* no specific system */ 98 #define SYSTEM_AIX 1 /* AIX */ 99 #define SYSTEM_CYGWIN 2 /* Cygwin */ 100 #define SYSTEM_DGUX 3 /* DG/UX */ 101 #define SYSTEM_DRSNX 4 /* DRS/NX */ 102 #define SYSTEM_DYNIX 5 /* DYNIX/ptx */ 103 #define SYSTEM_FREEBSD 6 /* FreeBSD */ 104 #define SYSTEM_HPUX 7 /* HP/UX */ 105 #define SYSTEM_IRIX 8 /* IRIX */ 106 #define SYSTEM_LINUX 9 /* Linux */ 107 #define SYSTEM_LYNXOS 10 /* LynxOS */ 108 #define SYSTEM_NETBSD 11 /* NetBSD */ 109 #define SYSTEM_OPENBSD 12 /* OpenBSD */ 110 #define SYSTEM_SINIX 13 /* SINIX */ 111 #define SYSTEM_SOLARIS 14 /* Solaris */ 112 #define SYSTEM_SUNOS 15 /* SunOS */ 113 #define SYSTEM_TRU64 16 /* Compaq Tru64 / Digital UNIX / OSF/1 */ 114 #define SYSTEM_UNIXWARE 17 /* UnixWare */ 115 116 117 #ifndef SYSTEM 118 #if TARGET == TARGET_UNIX 119 #if defined(AIX) || defined(_AIX) || defined(__AIX) || defined(__AIX__) 120 #define SYSTEM SYSTEM_AIX 121 #elif defined(CYGWIN) || defined(_CYGWIN) || defined(__CYGWIN) || \ 122 defined(__CYGWIN__) 123 #define SYSTEM SYSTEM_CYGWIN 124 #elif defined(DGUX) || defined(_DGUX) || defined(__DGUX) || defined(__DGUX__) 125 #define SYSTEM SYSTEM_DGUX 126 #elif defined(sequent) || defined(_sequent) || defined(__sequent) || \ 127 defined(__sequent__) || defined(SEQUENT) || defined(_SEQUENT_) 128 #define SYSTEM SYSTEM_DYNIX 129 #elif defined(__FreeBSD) || defined(__FreeBSD__) || defined(__DragonFly__) 130 #define SYSTEM SYSTEM_FREEBSD 131 #elif defined(hpux) || defined(_hpux) || defined(__hpux) || defined(__hpux__) 132 #define SYSTEM SYSTEM_HPUX 133 #elif defined(sgi) || defined(_sgi) || defined(__sgi) || defined(__sgi__) 134 #define SYSTEM SYSTEM_IRIX 135 #elif defined(linux) || defined(_linux) || defined(__linux) || \ 136 defined(__linux__) 137 #define SYSTEM SYSTEM_LINUX 138 #elif defined(__Lynx) || defined(__Lynx__) 139 #define SYSTEM SYSTEM_LYNXOS 140 #elif defined(__NetBSD) || defined(__NetBSD__) 141 #define SYSTEM SYSTEM_NETBSD 142 #elif defined(__OpenBSD) || defined(__OpenBSD__) 143 #define SYSTEM SYSTEM_OPENBSD 144 #elif defined(sinix) || defined(_sinix) || defined(__sinix) || \ 145 defined(__sinix__) || defined(SNI) || defined(_SNI) || defined(__SNI) || \ 146 defined(__SNI__) 147 #define SYSTEM SYSTEM_SINIX 148 #elif defined(sun) || defined(_sun) || defined(__sun) || defined(__sun__) 149 #if defined(svr4) || defined(_svr4) || defined(__svr4) || defined(__svr4__) || \ 150 defined(SVR4) || defined(_SVR4) || defined(__SVR4) || defined(__SVR4__) 151 #define SYSTEM SYSTEM_SOLARIS 152 #else /* svr4 */ 153 #define SYSTEM SYSTEM_SUNOS 154 #endif /* svr4 */ 155 #elif defined(digital) || defined(_digital) || defined(__digital) || \ 156 defined(__digital__) || defined(osf) || defined(_osf) || \ 157 defined(__osf) || defined(__osf__) 158 #define SYSTEM SYSTEM_TRU64 159 #else /* SYSTEM */ 160 #define SYSTEM SYSTEM_ANY 161 #endif /* SYSTEM */ 162 #else /* TARGET */ 163 #define SYSTEM SYSTEM_ANY 164 #endif /* TARGET */ 165 #endif /* SYSTEM */ 166 167 168 /* The string representation of the UNIX system variant. 169 */ 170 171 #if TARGET == TARGET_UNIX 172 #if SYSTEM == SYSTEM_AIX 173 #define SYSTEM_STR "AIX" 174 #elif SYSTEM == SYSTEM_CYGWIN 175 #define SYSTEM_STR "Cygwin" 176 #elif SYSTEM == SYSTEM_DGUX 177 #define SYSTEM_STR "DG/UX" 178 #elif SYSTEM == SYSTEM_DRSNX 179 #define SYSTEM_STR "DRS/NX" 180 #elif SYSTEM == SYSTEM_DYNIX 181 #define SYSTEM_STR "DYNIX/ptx" 182 #elif SYSTEM == SYSTEM_FREEBSD 183 #define SYSTEM_STR "FreeBSD" 184 #elif SYSTEM == SYSTEM_HPUX 185 #define SYSTEM_STR "HP/UX" 186 #elif SYSTEM == SYSTEM_IRIX 187 #define SYSTEM_STR "IRIX" 188 #elif SYSTEM == SYSTEM_LINUX 189 #define SYSTEM_STR "Linux" 190 #elif SYSTEM == SYSTEM_LYNXOS 191 #define SYSTEM_STR "LynxOS" 192 #elif SYSTEM == SYSTEM_NETBSD 193 #define SYSTEM_STR "NetBSD" 194 #elif SYSTEM == SYSTEM_OPENBSD 195 #define SYSTEM_STR "OpenBSD" 196 #elif SYSTEM == SYSTEM_SINIX 197 #define SYSTEM_STR "SINIX" 198 #elif SYSTEM == SYSTEM_SOLARIS 199 #define SYSTEM_STR "Solaris" 200 #elif SYSTEM == SYSTEM_SUNOS 201 #define SYSTEM_STR "SunOS" 202 #elif SYSTEM == SYSTEM_TRU64 203 #define SYSTEM_STR "Tru64" 204 #elif SYSTEM == SYSTEM_UNIXWARE 205 #define SYSTEM_STR "UnixWare" 206 #else /* SYSTEM */ 207 #define SYSTEM_STR "Unknown" 208 #endif /* SYSTEM */ 209 #else /* TARGET */ 210 #define SYSTEM_STR "N/A" 211 #endif /* TARGET */ 212 213 214 /* The processor architecture. This defines families of compatible processors 215 * from chip manufacturers rather than specific processor models. 216 */ 217 218 #define ARCH_ANY 0 /* no specific architecture */ 219 #define ARCH_ALPHA 1 /* DEC Alpha */ 220 #define ARCH_IA64 2 /* Intel Itanium */ 221 #define ARCH_IX86 3 /* Intel 80x86 */ 222 #define ARCH_M68K 4 /* Motorola 680x0 */ 223 #define ARCH_M88K 5 /* Motorola 88xx0 */ 224 #define ARCH_MIPS 6 /* MIPS */ 225 #define ARCH_PARISC 7 /* HP PA/RISC */ 226 #define ARCH_POWER 8 /* IBM RS/6000 */ 227 #define ARCH_POWERPC 9 /* PowerPC */ 228 #define ARCH_SPARC 10 /* SPARC */ 229 230 231 #ifndef ARCH 232 #if defined(ALPHA) || defined(_ALPHA) || defined(__ALPHA) || \ 233 defined(__ALPHA__) || defined(alpha) || defined(_alpha) || \ 234 defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA) 235 #define ARCH ARCH_ALPHA 236 #elif defined(ia64) || defined(_ia64) || defined(__ia64) || \ 237 defined(__a64__) || defined(IA64) || defined(_IA64) || \ 238 defined(__IA64) || defined(__IA64__) || defined(_M_IA64) 239 #define ARCH ARCH_IA64 240 #elif defined(i386) || defined(_i386) || defined(__i386) || \ 241 defined(__i386__) || defined(I386) || defined(_I386) || \ 242 defined(__I386) || defined(__I386__) || defined(ix86) || \ 243 defined(_ix86) || defined(__ix86) || defined(__ix86__) || \ 244 defined(x86) || defined(_x86) || defined(__x86) || defined(__x86__) || \ 245 defined(_M_IX86) 246 #define ARCH ARCH_IX86 247 #elif defined(m68k) || defined(_m68k) || defined(__m68k) || \ 248 defined(__m68k__) || defined(mc68000) || defined(_mc68000) || \ 249 defined(__mc68000) || defined(__mc68000__) || defined(M68000) || \ 250 defined(_M68000) || defined(__M68000) || defined(__M68000__) 251 #define ARCH ARCH_M68K 252 #elif defined(m88k) || defined(_m88k) || defined(__m88k) || \ 253 defined(__m88k__) || defined(m88000) || defined(_m88000) || \ 254 defined(__m88000) || defined(__m88000__) 255 #define ARCH ARCH_M88K 256 #elif defined(mips) || defined(_mips) || defined(__mips) || \ 257 defined(__mips__) || defined(_M_MRX000) 258 #define ARCH ARCH_MIPS 259 #elif defined(hppa) || defined(_hppa) || defined(__hppa) || defined(__hppa__) 260 #define ARCH ARCH_PARISC 261 #elif defined(POWER) || defined(_POWER) || defined(__POWER) || \ 262 defined(__POWER__) 263 #define ARCH ARCH_POWER 264 #elif defined(ppc) || defined(_ppc) || defined(__ppc) || defined(__ppc__) || \ 265 defined(powerpc) || defined(_powerpc) || defined(__powerpc) || \ 266 defined(__powerpc__) || defined(POWERPC) || defined(_POWERPC) || \ 267 defined(__POWERPC) || defined(__POWERPC__) || defined(_M_PPC) 268 #define ARCH ARCH_POWERPC 269 #elif defined(sparc) || defined(_sparc) || defined(__sparc) || \ 270 defined(__sparc__) 271 #define ARCH ARCH_SPARC 272 #else /* ARCH */ 273 #define ARCH ARCH_ANY 274 #endif /* ARCH */ 275 #endif /* ARCH */ 276 277 278 /* The string representation of the processor architecture. 279 */ 280 281 #if ARCH == ARCH_ALPHA 282 #define ARCH_STR "DEC Alpha" 283 #elif ARCH == ARCH_IA64 284 #define ARCH_STR "Intel Itanium" 285 #elif ARCH == ARCH_IX86 286 #define ARCH_STR "Intel 80x86" 287 #elif ARCH == ARCH_M68K 288 #define ARCH_STR "Motorola 680x0" 289 #elif ARCH == ARCH_M88K 290 #define ARCH_STR "Motorola 88xx0" 291 #elif ARCH == ARCH_MIPS 292 #define ARCH_STR "MIPS" 293 #elif ARCH == ARCH_PARISC 294 #define ARCH_STR "HP PA/RISC" 295 #elif ARCH == ARCH_POWER 296 #define ARCH_STR "IBM RS/6000" 297 #elif ARCH == ARCH_POWERPC 298 #define ARCH_STR "PowerPC" 299 #elif ARCH == ARCH_SPARC 300 #define ARCH_STR "SPARC" 301 #else /* ARCH */ 302 #define ARCH_STR "Unknown" 303 #endif /* ARCH */ 304 305 306 /* The processor word size. This is used to determine the size of pointers 307 * and long integers on the target processor. 308 */ 309 310 #define ENVIRON_ANY 0 /* no specific word size */ 311 #define ENVIRON_32 1 /* 32-bit */ 312 #define ENVIRON_64 2 /* 64-bit */ 313 314 315 #ifndef ENVIRON 316 #if defined(HAVE_CONFIG_H) && defined(SIZEOF_VOID_P) 317 #if SIZEOF_VOID_P == 4 318 #define ENVIRON ENVIRON_32 319 #elif SIZEOF_VOID_P == 8 320 #define ENVIRON ENVIRON_64 321 #else /* SIZEOF_VOID_P */ 322 #define ENVIRON ENVIRON_ANY 323 #endif /* SIZEOF_VOID_P */ 324 #else /* HAVE_CONFIG_H && SIZEOF_VOID_P */ 325 #if ARCH == ARCH_ALPHA || ARCH == ARCH_IA64 326 #define ENVIRON ENVIRON_64 327 #else /* ARCH */ 328 #if SYSTEM == SYSTEM_IRIX 329 #if defined(ABI64) || defined(_ABI64) 330 #define ENVIRON ENVIRON_64 331 #else /* ABI64 */ 332 #define ENVIRON ENVIRON_32 333 #endif /* ABI64 */ 334 #elif SYSTEM == SYSTEM_SOLARIS 335 #if defined(sparcv9) || defined(_sparcv9) || defined(__sparcv9) || \ 336 defined(__sparcv9__) 337 #define ENVIRON ENVIRON_64 338 #else /* sparcv9 */ 339 #define ENVIRON ENVIRON_32 340 #endif /* sparcv9 */ 341 #elif SYSTEM == SYSTEM_TRU64 342 #if defined(arch64) || defined(_arch64) || defined(__arch64) || \ 343 defined(__arch64__) 344 #define ENVIRON ENVIRON_64 345 #else /* arch64 */ 346 #define ENVIRON ENVIRON_32 347 #endif /* arch64 */ 348 #else /* SYSTEM */ 349 #define ENVIRON ENVIRON_32 350 #endif /* SYSTEM */ 351 #endif /* ARCH */ 352 #endif /* HAVE_CONFIG_H && SIZEOF_VOID_P */ 353 #endif /* ENVIRON */ 354 355 356 /* The string representation of the processor word size. 357 */ 358 359 #if ENVIRON == ENVIRON_32 360 #define ENVIRON_STR "32-bit" 361 #elif ENVIRON == ENVIRON_64 362 #define ENVIRON_STR "64-bit" 363 #else /* ENVIRON */ 364 #define ENVIRON_STR "Unknown" 365 #endif /* ENVIRON */ 366 367 368 /* The object file format. This can either specify an explicit file format 369 * for executable files and shared libraries, or specify an object file access 370 * library. 371 */ 372 373 #define FORMAT_NONE 0 /* no symbol support */ 374 #define FORMAT_AOUT 1 /* a.out */ 375 #define FORMAT_COFF 2 /* COFF */ 376 #define FORMAT_XCOFF 3 /* XCOFF */ 377 #define FORMAT_ELF32 4 /* ELF32 */ 378 #define FORMAT_ELF64 5 /* ELF64 */ 379 #define FORMAT_BFD 6 /* GNU BFD */ 380 #define FORMAT_PE 7 /* Portable Executable */ 381 382 383 #ifndef FORMAT 384 #if TARGET == TARGET_UNIX 385 #if SYSTEM == SYSTEM_AIX 386 #define FORMAT FORMAT_XCOFF 387 #elif SYSTEM == SYSTEM_DGUX || SYSTEM == SYSTEM_DRSNX || \ 388 SYSTEM == SYSTEM_DYNIX || SYSTEM == SYSTEM_IRIX || \ 389 SYSTEM == SYSTEM_SINIX || SYSTEM == SYSTEM_SOLARIS || \ 390 SYSTEM == SYSTEM_UNIXWARE 391 #if ENVIRON == ENVIRON_64 392 #define FORMAT FORMAT_ELF64 393 #else /* ENVIRON */ 394 #define FORMAT FORMAT_ELF32 395 #endif /* ENVIRON */ 396 #elif SYSTEM == SYSTEM_FREEBSD || SYSTEM == SYSTEM_NETBSD || \ 397 SYSTEM == SYSTEM_OPENBSD || SYSTEM == SYSTEM_SUNOS 398 #ifdef __ELF__ 399 #if ENVIRON == ENVIRON_64 400 #define FORMAT FORMAT_ELF64 401 #else /* ENVIRON */ 402 #define FORMAT FORMAT_ELF32 403 #endif /* ENVIRON */ 404 #else /* __ELF__ */ 405 #define FORMAT FORMAT_AOUT 406 #endif /* __ELF__ */ 407 #elif SYSTEM == SYSTEM_CYGWIN || SYSTEM == SYSTEM_HPUX || \ 408 SYSTEM == SYSTEM_LINUX || SYSTEM == SYSTEM_LYNXOS || \ 409 SYSTEM == SYSTEM_TRU64 410 #define FORMAT FORMAT_BFD 411 #else /* SYSTEM */ 412 #define FORMAT FORMAT_NONE 413 #endif /* SYSTEM */ 414 #elif TARGET == TARGET_WINDOWS 415 #ifdef __GNUC__ 416 #define FORMAT FORMAT_BFD 417 #else /* __GNUC__ */ 418 #define FORMAT FORMAT_PE 419 #endif /* __GNUC__ */ 420 #else /* TARGET */ 421 #if TARGET == TARGET_AMIGA && defined(__GNUC__) 422 #define FORMAT FORMAT_BFD 423 #else /* TARGET && __GNUC__ */ 424 #define FORMAT FORMAT_NONE 425 #endif /* TARGET && __GNUC__ */ 426 #endif /* TARGET */ 427 #endif /* FORMAT */ 428 429 430 /* The string representation of the object file format. 431 */ 432 433 #if FORMAT == FORMAT_AOUT 434 #define FORMAT_STR "a.out" 435 #elif FORMAT == FORMAT_COFF 436 #define FORMAT_STR "COFF" 437 #elif FORMAT == FORMAT_XCOFF 438 #define FORMAT_STR "XCOFF" 439 #elif FORMAT == FORMAT_ELF32 440 #define FORMAT_STR "ELF32" 441 #elif FORMAT == FORMAT_ELF64 442 #define FORMAT_STR "ELF64" 443 #elif FORMAT == FORMAT_BFD 444 #define FORMAT_STR "BFD" 445 #elif FORMAT == FORMAT_PE 446 #define FORMAT_STR "PE" 447 #else /* FORMAT */ 448 #define FORMAT_STR "Unknown" 449 #endif /* FORMAT */ 450 451 452 /* The dynamic linker type. This is used to specify the method used to obtain 453 * information about the shared libraries that a program requires when it is 454 * running. 455 */ 456 457 #define DYNLINK_NONE 0 /* no dynamic linker support */ 458 #define DYNLINK_AIX 1 /* AIX dynamic linker */ 459 #define DYNLINK_BSD 2 /* BSD dynamic linker */ 460 #define DYNLINK_HPUX 3 /* HP/UX dynamic linker */ 461 #define DYNLINK_IRIX 4 /* IRIX dynamic linker */ 462 #define DYNLINK_OSF 5 /* OSF dynamic linker */ 463 #define DYNLINK_SVR4 6 /* SVR4 dynamic linker */ 464 #define DYNLINK_WINDOWS 7 /* Windows dynamic linker */ 465 466 467 #ifndef DYNLINK 468 #if TARGET == TARGET_UNIX 469 #if SYSTEM == SYSTEM_AIX 470 #define DYNLINK DYNLINK_AIX 471 #elif SYSTEM == SYSTEM_CYGWIN 472 #define DYNLINK DYNLINK_WINDOWS 473 #elif SYSTEM == SYSTEM_DGUX || SYSTEM == SYSTEM_DRSNX || \ 474 SYSTEM == SYSTEM_DYNIX || SYSTEM == SYSTEM_LINUX || \ 475 SYSTEM == SYSTEM_SINIX || SYSTEM == SYSTEM_SOLARIS || \ 476 SYSTEM == SYSTEM_UNIXWARE 477 #define DYNLINK DYNLINK_SVR4 478 #elif SYSTEM == SYSTEM_FREEBSD || SYSTEM == SYSTEM_NETBSD || \ 479 SYSTEM == SYSTEM_OPENBSD || SYSTEM == SYSTEM_SUNOS 480 #ifdef __ELF__ 481 #define DYNLINK DYNLINK_SVR4 482 #else /* __ELF__ */ 483 #define DYNLINK DYNLINK_BSD 484 #endif /* __ELF__ */ 485 #elif SYSTEM == SYSTEM_HPUX 486 #define DYNLINK DYNLINK_HPUX 487 #elif SYSTEM == SYSTEM_IRIX 488 #define DYNLINK DYNLINK_IRIX 489 #elif SYSTEM == SYSTEM_TRU64 490 #define DYNLINK DYNLINK_OSF 491 #else /* SYSTEM */ 492 #define DYNLINK DYNLINK_NONE 493 #endif /* SYSTEM */ 494 #elif TARGET == TARGET_WINDOWS 495 #define DYNLINK DYNLINK_WINDOWS 496 #else /* TARGET */ 497 #define DYNLINK DYNLINK_NONE 498 #endif /* TARGET */ 499 #endif /* DYNLINK */ 500 501 502 /* The string representation of the dynamic linker type. 503 */ 504 505 #if DYNLINK == DYNLINK_AIX 506 #define DYNLINK_STR "AIX" 507 #elif DYNLINK == DYNLINK_BSD 508 #define DYNLINK_STR "BSD" 509 #elif DYNLINK == DYNLINK_HPUX 510 #define DYNLINK_STR "HP/UX" 511 #elif DYNLINK == DYNLINK_IRIX 512 #define DYNLINK_STR "IRIX" 513 #elif DYNLINK == DYNLINK_OSF 514 #define DYNLINK_STR "OSF" 515 #elif DYNLINK == DYNLINK_SVR4 516 #define DYNLINK_STR "SVR4" 517 #elif DYNLINK == DYNLINK_WINDOWS 518 #define DYNLINK_STR "Windows" 519 #else /* DYNLINK */ 520 #define DYNLINK_STR "Unknown" 521 #endif /* DYNLINK */ 522 523 524 /* Target feature macros. Some systems require certain preprocessor macros 525 * to be defined before non-standard definitions in system header files are 526 * included. 527 */ 528 529 #if TARGET == TARGET_UNIX 530 #if SYSTEM != SYSTEM_FREEBSD && SYSTEM != SYSTEM_NETBSD && \ 531 SYSTEM != SYSTEM_OPENBSD 532 #ifndef _POSIX_SOURCE 533 #define _POSIX_SOURCE 1 534 #endif /* _POSIX_SOURCE */ 535 #ifndef _POSIX_C_SOURCE 536 #define _POSIX_C_SOURCE 199506L 537 #endif /* _POSIX_C_SOURCE */ 538 #endif /* SYSTEM */ 539 #if SYSTEM == SYSTEM_AIX 540 #ifndef _ALL_SOURCE 541 #define _ALL_SOURCE 1 542 #endif /* _ALL_SOURCE */ 543 #elif SYSTEM == SYSTEM_DGUX 544 #ifndef _DGUX_SOURCE 545 #define _DGUX_SOURCE 1 546 #endif /* _DGUX_SOURCE */ 547 #elif SYSTEM == SYSTEM_HPUX 548 #ifndef _HPUX_SOURCE 549 #define _HPUX_SOURCE 1 550 #endif /* _HPUX_SOURCE */ 551 #elif SYSTEM == SYSTEM_IRIX 552 #ifndef _SGI_SOURCE 553 #define _SGI_SOURCE 1 554 #endif /* _SGI_SOURCE */ 555 #elif SYSTEM == SYSTEM_LINUX 556 #ifndef _GNU_SOURCE 557 #define _GNU_SOURCE 1 558 #endif /* _GNU_SOURCE */ 559 #elif SYSTEM == SYSTEM_SOLARIS 560 #ifndef __EXTENSIONS__ 561 #define __EXTENSIONS__ 1 562 #endif /* __EXTENSIONS__ */ 563 #elif SYSTEM == SYSTEM_TRU64 564 #ifndef _OSF_SOURCE 565 #define _OSF_SOURCE 1 566 #endif /* _OSF_SOURCE */ 567 #ifndef _XOPEN_SOURCE_EXTENDED 568 #define _XOPEN_SOURCE_EXTENDED 1 569 #endif /* _XOPEN_SOURCE_EXTENDED */ 570 #endif /* SYSTEM */ 571 #endif /* TARGET */ 572 573 574 #endif /* MP_TARGET_H */ 575