c99defs.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. * TODO: Check for VC2013, because it actually supports this C99 stuff.
  24. */
  25. #ifdef _MSC_VER
  26. #define EXPORT extern __declspec(dllexport)
  27. #else
  28. #define EXPORT extern
  29. #endif
  30. #ifdef _MSC_VER
  31. #pragma warning (disable : 4996)
  32. #ifndef __cplusplus
  33. #define inline __inline
  34. #endif
  35. #include "vc/stdint.h"
  36. #include "vc/stdbool.h"
  37. #ifndef __off_t_defined
  38. #define __off_t_defined
  39. #if _FILE_OFFSET_BITS == 64
  40. typedef long long off_t;
  41. #else
  42. typedef long off_t;
  43. #endif
  44. typedef int64_t off64_t;
  45. #endif /* __off_t_defined */
  46. #else
  47. #include <stdint.h>
  48. #include <stdbool.h>
  49. #include <sys/types.h>
  50. #endif /* _MSC_VER */