DefsVcWin32.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // This code is in the public domain -- Ignacio Castaño <castano@gmail.com>
  2. #ifndef NV_CORE_H
  3. #error "Do not include this file directly."
  4. #endif
  5. // Function linkage
  6. #define DLL_IMPORT __declspec(dllimport)
  7. #define DLL_EXPORT __declspec(dllexport)
  8. #define DLL_EXPORT_CLASS DLL_EXPORT
  9. // Function calling modes
  10. #define NV_CDECL __cdecl
  11. #define NV_STDCALL __stdcall
  12. #define NV_FASTCALL __fastcall
  13. #define NV_DEPRECATED
  14. #define NV_PURE
  15. #define NV_CONST
  16. // Set standard function names.
  17. #if _MSC_VER < 1900
  18. # define snprintf _snprintf
  19. #endif
  20. #if _MSC_VER < 1500
  21. # define vsnprintf _vsnprintf
  22. #endif
  23. #if _MSC_VER < 1700
  24. # define strtoll _strtoi64
  25. # define strtoull _strtoui64
  26. #endif
  27. //#define chdir _chdir
  28. #define getcwd _getcwd
  29. #if _MSC_VER <= 1600
  30. #define va_copy(a, b) (a) = (b)
  31. #endif
  32. #if !defined restrict
  33. #define restrict
  34. #endif
  35. // Ignore gcc attributes.
  36. #define __attribute__(X)
  37. #if !defined __FUNC__
  38. #define __FUNC__ __FUNCTION__
  39. #endif
  40. #define NV_NOINLINE __declspec(noinline)
  41. #define NV_FORCEINLINE __forceinline
  42. #define NV_THREAD_LOCAL __declspec(thread)
  43. /*
  44. // Type definitions
  45. typedef unsigned char uint8;
  46. typedef signed char int8;
  47. typedef unsigned short uint16;
  48. typedef signed short int16;
  49. typedef unsigned int uint32;
  50. typedef signed int int32;
  51. typedef unsigned __int64 uint64;
  52. typedef signed __int64 int64;
  53. // Aliases
  54. typedef uint32 uint;
  55. */
  56. // Unwanted VC++ warnings to disable.
  57. /*
  58. #pragma warning(disable : 4244) // conversion to float, possible loss of data
  59. #pragma warning(disable : 4245) // conversion from 'enum ' to 'unsigned long', signed/unsigned mismatch
  60. #pragma warning(disable : 4100) // unreferenced formal parameter
  61. #pragma warning(disable : 4514) // unreferenced inline function has been removed
  62. #pragma warning(disable : 4710) // inline function not expanded
  63. #pragma warning(disable : 4127) // Conditional expression is constant
  64. #pragma warning(disable : 4305) // truncation from 'const double' to 'float'
  65. #pragma warning(disable : 4505) // unreferenced local function has been removed
  66. #pragma warning(disable : 4702) // unreachable code in inline expanded function
  67. #pragma warning(disable : 4711) // function selected for automatic inlining
  68. #pragma warning(disable : 4725) // Pentium fdiv bug
  69. #pragma warning(disable : 4786) // Identifier was truncated and cannot be debugged.
  70. #pragma warning(disable : 4675) // resolved overload was found by argument-dependent lookup
  71. */
  72. #pragma warning(1 : 4705) // Report unused local variables.
  73. #pragma warning(1 : 4555) // Expression has no effect.