bindef.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Only do native on Linux/i386 by default -- it's safer. */
  2. #ifndef DETECTAOUT
  3. #if defined(__i386__) && defined(__linux__)
  4. #define DETECTAOUT
  5. #else
  6. # ifdef A_OUT_INCL
  7. # define DETECTAOUT
  8. # endif
  9. #endif
  10. #endif
  11. #ifdef DETECTAOUT
  12. /* Ok, I'm just gonna make it simple ... override this if you like. */
  13. #ifndef A_OUT_INCL
  14. #define A_OUT_INCL <a.out.h>
  15. #endif
  16. #include A_OUT_INCL
  17. /* Try and guess type ... */
  18. #ifndef V7_A_OUT
  19. #ifndef BSD_A_OUT
  20. #ifndef STANDARD_GNU_A_OUT
  21. # ifndef C_EXT
  22. # define BSD_A_OUT
  23. # endif
  24. /* Not sure about this one ... it works here ... */
  25. # if defined(BSD_A_OUT) && defined(N_MAGIC)
  26. # define STANDARD_GNU_A_OUT
  27. # endif
  28. #endif
  29. #endif
  30. #endif
  31. /* General specs as to how it works ... */
  32. # ifdef BSD_A_OUT
  33. # ifdef STANDARD_GNU_A_OUT
  34. # define RELOC_INFO_SIZE 8 /* unportable bitfields - bcc doesn't pack */
  35. # else
  36. # define RELOC_INFO_SIZE (sizeof (struct relocation_info))
  37. # endif
  38. # ifdef N_EXT
  39. # define C_EXT N_EXT
  40. # endif
  41. # define C_STAT 0
  42. # define n_was_name n_un.n_name
  43. # define n_was_numaux n_other
  44. # define n_was_other n_numaux
  45. # define n_was_sclass n_type
  46. # define n_was_strx n_un.n_strx
  47. # define n_was_type n_desc
  48. # else /* not BSD_A_OUT */
  49. # define RELOC_INFO_SIZE (sizeof (struct reloc))
  50. # define n_was_name n_name
  51. # define n_was_numaux n_numaux
  52. # define n_was_other n_other
  53. # define n_was_sclass n_sclass
  54. # define n_was_strx n_value
  55. # define n_was_type n_type
  56. # endif /* BSD_A_OUT */
  57. /* And finally make sure it worked */
  58. #if defined(A_MINHDR) || defined(BSD_A_OUT)
  59. #if defined(C_EXT) && defined(C_STAT) && !defined(SCNHSZ)
  60. #define AOUT_DETECTED 1
  61. #endif
  62. #endif
  63. #endif /* NO_AOUT */