2
0

kludge.h 1.5 KB

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