CCStdC.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 "platform/CCPlatformConfig.h"
  24. #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
  25. #define WIN32_LEAN_AND_MEAN
  26. #include <Windows.h>
  27. #if _MSC_VER < 1800
  28. #if !defined(isnan)
  29. #define isnan _isnan
  30. #endif
  31. #endif
  32. #include <math.h>
  33. #include <string.h>
  34. #include <stdarg.h>
  35. #include <stdio.h>
  36. #include <stdlib.h>
  37. #include <time.h>
  38. #if _MSC_VER >= 1600
  39. #include <stdint.h>
  40. #else
  41. #include "platform/win32/compat/stdint.h"
  42. #endif
  43. // Conflicted with ParticleSystem::PositionType::RELATIVE, so we need to undef it.
  44. #ifdef RELATIVE
  45. #undef RELATIVE
  46. #endif
  47. // Conflicted with CCBReader::SizeType::RELATIVE and CCBReader::ScaleType::RELATIVE, so we need to undef it.
  48. #ifdef ABSOLUTE
  49. #undef ABSOLUTE
  50. #endif
  51. // Conflicted with HttpRequest::Type::DELETE, so we need to undef it.
  52. #ifdef DELETE
  53. #undef DELETE
  54. #endif
  55. #undef min
  56. #undef max
  57. #else
  58. #include <float.h>
  59. #include <math.h>
  60. #include <string.h>
  61. #include <stdarg.h>
  62. #include <stdio.h>
  63. #include <stdlib.h>
  64. #include <time.h>
  65. #include <sys/time.h>
  66. #include <stdint.h>
  67. #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32