config.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  3. * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Library General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public License
  16. * along with this library; see the file COPYING.LIB. If not, write to
  17. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. *
  20. */
  21. #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
  22. #ifdef BUILDING_WITH_CMAKE
  23. #include "cmakeconfig.h"
  24. #else
  25. #include "autotoolsconfig.h"
  26. #endif
  27. #endif
  28. #include <wtf/Platform.h>
  29. #include <wtf/ExportMacros.h>
  30. #if !defined(BUILDING_WTF)
  31. #include "JSExportMacros.h"
  32. #endif
  33. #if OS(WINDOWS)
  34. #ifndef _WIN32_WINNT
  35. #define _WIN32_WINNT 0x0502
  36. #endif
  37. #ifndef WINVER
  38. #define WINVER 0x0502
  39. #endif
  40. // If we don't define these, they get defined in windef.h.
  41. // We want to use std::min and std::max
  42. #define max max
  43. #define min min
  44. #if !COMPILER(MSVC7_OR_LOWER) && !OS(WINCE)
  45. // We need to define this before the first #include of stdlib.h or it won't contain rand_s.
  46. #ifndef _CRT_RAND_S
  47. #define _CRT_RAND_S
  48. #endif
  49. #endif // !COMPILER(MSVC7_OR_LOWER) && !OS(WINCE)
  50. #endif // OS(WINDOWS)
  51. #define WTF_CHANGES 1
  52. #ifdef __cplusplus
  53. #undef new
  54. #undef delete
  55. #include <wtf/FastMalloc.h>
  56. #endif
  57. #include <wtf/DisallowCType.h>
  58. #if COMPILER(MSVC)
  59. #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
  60. #else
  61. #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
  62. #endif
  63. #if PLATFORM(MANX)
  64. #include <manx/util.h>
  65. #define PUSH_CPU_MARKER(label, color) pa_push_marker(label, color)
  66. #define POP_CPU_MARKER() pa_pop_marker()
  67. #define CPU_SYNC() pa_sync()
  68. #ifdef __cplusplus
  69. class ScopedMarker
  70. {
  71. public:
  72. ScopedMarker(const char* label, unsigned int color) { PUSH_CPU_MARKER(label, color); }
  73. ~ScopedMarker() { POP_CPU_MARKER(); }
  74. };
  75. #define TOKENPASTE(x, y) x ## y
  76. #define TOKENPASTE2(x, y) TOKENPASTE(x, y)
  77. #define SCOPED_MARKER(label, color) ScopedMarker TOKENPASTE2(marker, __LINE__)(label, color)
  78. #define FUNCTION_MARKER SCOPED_MARKER(__PRETTY_FUNCTION__, PA_COLOR_GREEN)
  79. #endif // __cplusplus
  80. #endif