CCStdC-win32.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /****************************************************************************
  2. Copyright (c) 2010-2012 cocos2d-x.org
  3. Copyright (c) 2013-2016 Chukong Technologies Inc.
  4. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
  5. http://www.cocos2d-x.org
  6. Permission is hereby granted, free of charge, to any person obtaining a copy
  7. of this software and associated documentation files (the "Software"), to deal
  8. in the Software without restriction, including without limitation the rights
  9. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom the Software is
  11. furnished to do so, subject to the following conditions:
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. THE SOFTWARE.
  21. ****************************************************************************/
  22. #pragma once
  23. #include <BaseTsd.h>
  24. #ifndef __SSIZE_T
  25. #define __SSIZE_T
  26. typedef SSIZE_T ssize_t;
  27. #endif // __SSIZE_T
  28. #include <float.h>
  29. // for math.h on win32 platform
  30. #ifndef __MINGW32__
  31. #if !defined(_USE_MATH_DEFINES)
  32. #define _USE_MATH_DEFINES // make M_PI can be use
  33. #endif
  34. #if _MSC_VER < 1800
  35. #if !defined(isnan)
  36. #define isnan _isnan
  37. #endif
  38. #endif
  39. #if _MSC_VER < 1900
  40. #ifndef snprintf
  41. #define snprintf _snprintf
  42. #endif
  43. #endif
  44. #endif // __MINGW32__
  45. #include <math.h>
  46. #include <string.h>
  47. #include <stdarg.h>
  48. #include <stdio.h>
  49. #include <stdlib.h>
  50. #include <time.h>
  51. #ifndef M_PI
  52. #define M_PI 3.14159265358
  53. #endif
  54. #ifndef M_PI_2
  55. #define M_PI_2 1.57079632679
  56. #endif
  57. // for MIN MAX and sys/time.h on win32 platform
  58. #if _MSC_VER >= 1600 || defined(__MINGW32__)
  59. #include <stdint.h>
  60. #else
  61. #include "platform/win32/compat/stdint.h"
  62. #endif
  63. // Conflicted with ParticleSystem::PositionType::RELATIVE, so we need to undef it.
  64. #ifdef RELATIVE
  65. #undef RELATIVE
  66. #endif
  67. // Conflicted with CCBReader::SizeType::RELATIVE and CCBReader::ScaleType::RELATIVE, so we need to undef it.
  68. #ifdef ABSOLUTE
  69. #undef ABSOLUTE
  70. #endif
  71. // Conflicted with HttpRequest::Type::DELETE, so we need to undef it.
  72. #ifdef DELETE
  73. #undef DELETE
  74. #endif
  75. #undef min
  76. #undef max