c99defs.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /******************************************************************************
  2. Copyright (c) 2013 by Hugh Bailey <[email protected]>
  3. This software is provided 'as-is', without any express or implied
  4. warranty. In no event will the authors be held liable for any damages
  5. arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it
  8. freely, subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not
  10. claim that you wrote the original software. If you use this software
  11. in a product, an acknowledgment in the product documentation would be
  12. appreciated but is not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source
  16. distribution.
  17. ******************************************************************************/
  18. #pragma once
  19. /*
  20. * Contains hacks for getting some C99 stuff working in VC, things like
  21. * bool, inline, stdint
  22. */
  23. #ifdef _MSC_VER
  24. #pragma warning (disable : 4996)
  25. /* Microsoft is one of the most inept companies on the face of the planet.
  26. * The fact that even visual studio 2013 doesn't support the standard 'inline'
  27. * keyword is so incredibly stupid that I just can't imagine what sort of
  28. * incredibly inept moron could possibly be managing the visual C compiler
  29. * project. They should be fired, and legally forbidden to have a job in
  30. * ANYTHING even REMOTELY related to programming. FOREVER. This should also
  31. * apply to the next 10 generations all of their descendents. */
  32. #ifndef __cplusplus
  33. #define inline __inline
  34. #endif
  35. #define EXPORT extern __declspec(dllexport)
  36. #else
  37. #define EXPORT extern
  38. #endif
  39. #if _MSC_VER && _MSC_VER < 0x0708
  40. #include "vc/vc_stdint.h"
  41. #include "vc/vc_stdbool.h"
  42. #ifndef __off_t_defined
  43. #define __off_t_defined
  44. #if _FILE_OFFSET_BITS == 64
  45. typedef long long off_t;
  46. #else
  47. typedef long off_t;
  48. #endif
  49. typedef int64_t off64_t;
  50. #endif /* __off_t_defined */
  51. #define SIZE_T_FORMAT "%u"
  52. #else
  53. #include <stdint.h>
  54. #include <stdbool.h>
  55. #include <sys/types.h>
  56. #define SIZE_T_FORMAT "%zu"
  57. #endif /* _MSC_VER */