2
0

kludge.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #if NO_MEMMOVE /* memove() not in libraries */
  13. #define memmove(dest,src,len) bcopy(src,dest,len)
  14. #endif
  15. #if NO_STRTOUL /* strtoul() not in libraries */
  16. #define strtoul strtol /* Close enough */
  17. #endif
  18. #if NO_RAISE /* raise() not in libraries */
  19. #include <sys/types.h> /* For getpid() - kill() is in <signal.h> */
  20. #define raise(sig) kill(getpid(),sig)
  21. #endif
  22. /*
  23. * Make Microsoft Visual C shut the hell up about a few things...
  24. * Warning 4116 complains about the alignof() macro, saying:
  25. * warning C4116: unnamed type definition in parentheses
  26. * I do not know of a reasonable way to recode to eliminate this warning.
  27. * Warning 4761 complains about passing an expression (which has
  28. * type int) to a function expecting something narrower - like
  29. * a ringmask, if ringmask is set to 8 bits. The error is:
  30. * warning C4761: integral size mismatch in argument : conversion supplied
  31. * I do not know of a reasonable way to recode to eliminate this warning.
  32. */
  33. #ifdef _MSC_VER
  34. #pragma warning(disable: 4116 4761)
  35. #endif
  36. /*
  37. * Borland C seems to think that it's a bad idea to decleare a
  38. * structure tag and not declare the contents. I happen to think
  39. * it's a *good* idea to use such "opaque" structures wherever
  40. * possible. So shut up.
  41. */
  42. #ifdef __BORLANDC__
  43. #pragma warn -stu
  44. #endif
  45. /* Cope with people forgetting to define the OS, if possible... */
  46. #if !defined(MSDOS) && defined(__MSDOS__)
  47. #define MSDOS 1
  48. #endif
  49. #if !defined(UNIX) && (defined(unix) || defined (__unix__))
  50. #define UNIX 1
  51. #endif
  52. #endif /* KLUDGE_H */