/libs/libzrtp/third_party/bnlib/test/kludge.h

https://github.com/curriegrad2004/FreeSWITCH · C Header · 97 lines · 50 code · 14 blank · 33 comment · 5 complexity · c4f6bd6b42f6a106e0cd03e19eefcead MD5 · raw file

  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. * If there are no prototypes for the stdio functions, to reduce
  24. * compiler warnings include these... conditional on EOF being
  25. * defined (a giveaway that <stdio.h> was #included).
  26. */
  27. #if defined(EOF)
  28. #if NO_STDIO_PROTOS /* Missing prototypes for "simple" functions */
  29. int (puts)(char const *);
  30. int (fputs)(char const *, FILE *);
  31. void (rewind)(FILE *);
  32. int (fflush)(FILE *);
  33. int (fclose)(FILE *);
  34. int (printf)(char const *, ...);
  35. int (fprintf)(FILE *, char const *, ...);
  36. int (fseek)(FILE *, long, int);
  37. int (remove)(char const *);
  38. int (rename)(char const *, char const *);
  39. void (perror)(char const *);
  40. int (system)(char const *); /* Really in <stdlib.h>, but this'll do... */
  41. int (pclose)(FILE *);
  42. /* If we have a sufficiently old-fashioned stdio, it probably uses these... */
  43. int (_flsbuf)(int, FILE *);
  44. int (_filbuf)(FILE *);
  45. int (ungetc)(int, FILE *);
  46. size_t (fread)(char *, size_t, size_t, FILE *);
  47. size_t (fwrite)(char const *, size_t, size_t, FILE *);
  48. #if defined(va_start) || defined(va_arg) || defined(va_end)
  49. int (vfprintf)(FILE *, char const *, ...);
  50. #endif
  51. #endif /* NO_STDIO_PROTOS */
  52. #endif /* EOF */
  53. /*
  54. * Make Microsoft Visual C shut the hell up about a few things...
  55. * Warning 4116 complains about the alignof() macro, saying:
  56. * warning C4116: unnamed type definition in parentheses
  57. * I do not know of a reasonable way to recode to eliminate this warning.
  58. * Warning 4761 complains about passing an expression (which has
  59. * type int) to a function expecting something narrower - like
  60. * a ringmask, if ringmask is set to 8 bits. The error is:
  61. * warning C4761: integral size mismatch in argument : conversion supplied
  62. * I do not know of a reasonable way to recode to eliminate this warning.
  63. */
  64. #ifdef _MSC_VER
  65. #pragma warning(disable: 4116 4761)
  66. #endif
  67. /*
  68. * Borland C seems to think that it's a bad idea to decleare a
  69. * structure tag and not declare the contents. I happen to think
  70. * it's a *good* idea to use such "opaque" structures wherever
  71. * possible. So shut up.
  72. */
  73. #ifdef __BORLANDC__
  74. #pragma warn -stu
  75. #endif
  76. /* Cope with people forgetting to define the OS, if possible... */
  77. #if !defined(MSDOS) && defined(__MSDOS__)
  78. #define MSDOS 1
  79. #endif
  80. #if !defined(UNIX) && (defined(unix) || defined (__unix__))
  81. #define UNIX 1
  82. #endif
  83. #endif /* KLUDGE_H */