patch-include_my_global_h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- mysql-5.0.85.orig/include/my_global.h 2009-08-11 12:50:17.000000000 +0200
  3. +++ mysql-5.0.85/include/my_global.h 2009-08-27 22:21:39.363259500 +0200
  4. @@ -350,29 +350,32 @@ C_MODE_END
  5. #ifdef HAVE_UNISTD_H
  6. #include <unistd.h>
  7. #endif
  8. +
  9. #if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
  10. #undef HAVE_ALLOCA
  11. #undef HAVE_ALLOCA_H
  12. #endif
  13. -#ifdef HAVE_ALLOCA_H
  14. -#include <alloca.h>
  15. +
  16. +#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
  17. +#ifndef BSD
  18. +#define BSD
  19. #endif
  20. -#ifdef HAVE_ATOMIC_ADD
  21. -#define new my_arg_new
  22. -#define need_to_restore_new 1
  23. -C_MODE_START
  24. -#include <asm/atomic.h>
  25. -C_MODE_END
  26. -#ifdef need_to_restore_new /* probably safer than #ifdef new */
  27. -#undef new
  28. -#undef need_to_restore_new
  29. #endif
  30. +
  31. +#if defined(HAVE_ALLOCA_H) && !defined(BSD)
  32. +#include <alloca.h>
  33. #endif
  34. +
  35. #include <errno.h> /* Recommended by debian */
  36. /* We need the following to go around a problem with openssl on solaris */
  37. +#ifdef BSD
  38. +#include <pwd.h>
  39. +#include <unistd.h>
  40. +#else
  41. #if defined(HAVE_CRYPT_H)
  42. #include <crypt.h>
  43. #endif
  44. +#endif
  45. /*
  46. A lot of our programs uses asserts, so better to always include it
  47. @@ -791,9 +794,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
  48. #define finite(x) (1.0 / fabs(x) > 0.0)
  49. #endif
  50. +/*
  51. #ifndef HAVE_ISNAN
  52. #define isnan(x) ((x) != (x))
  53. #endif
  54. +*/
  55. #ifdef HAVE_ISINF
  56. /* Check if C compiler is affected by GCC bug #39228 */