kludge.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef KLUDGE_H
  2. #define KLUDGE_H
  3. /*
  4. * Kludges for not-quite-ANSI systems.
  5. * This should always be the last file included, because it may
  6. * mess up some system header files.
  7. */
  8. /*
  9. * Some compilers complain about #if FOO if FOO isn't defined,
  10. * so do the ANSI-mandated thing explicitly...
  11. */
  12. #ifndef NO_STDLIB_H
  13. #define NO_STDLIB_H 0
  14. #endif
  15. #ifndef NO_MEMMOVE
  16. #define NO_MEMMOVE 0
  17. #endif
  18. #if NO_MEMMOVE /* memove() not in libraries */
  19. #define memmove(dest,src,len) bcopy(src,dest,len)
  20. #endif
  21. #ifndef NO_MEMCPY
  22. #define NO_MEMCPY 0
  23. #endif
  24. #if NO_MEMCPY /* memcpy() not in libraries */
  25. #define memcpy(dest,src,len) bcopy(src,dest,len)
  26. #endif
  27. /*
  28. * Borland C seems to think that it's a bad idea to decleare a
  29. * structure tag and not declare the contents. I happen to think
  30. * it's a *good* idea to use such "opaque" structures wherever
  31. * possible. So shut up.
  32. */
  33. #ifdef __BORLANDC__
  34. #pragma warn -stu
  35. #ifndef MSDOS
  36. #define MSDOS 1
  37. #endif
  38. #endif
  39. /* Turn off warning about negation of unsigned values */
  40. #ifdef _MSC_VER
  41. #pragma warning(disable:4146)
  42. #endif
  43. /* Cope with people forgetting to define the OS, if possible... */
  44. #ifndef MSDOS
  45. #ifdef __MSDOS
  46. #define MSDOS 1
  47. #endif
  48. #endif
  49. #ifndef MSDOS
  50. #ifdef __MSDOS__
  51. #define MSDOS 1
  52. #endif
  53. #endif
  54. /* By MS-DOS, we mean 16-bit brain-dead MS-DOS. Not GCC & GO32 */
  55. #ifdef __GO32
  56. #undef MSDOS
  57. #endif
  58. #ifdef __GO32__
  59. #undef MSDOS
  60. #endif
  61. #endif /* KLUDGE_H */