2010-07-22 10:25:14 +00:00
|
|
|
#ifndef NV_CORE_H
|
|
|
|
#error "Do not include this file directly."
|
|
|
|
#endif
|
|
|
|
|
2011-09-27 17:48:46 +00:00
|
|
|
#include <stdint.h> // uint8_t, int8_t, ... uintptr_t
|
2012-04-30 23:02:23 +00:00
|
|
|
#include <stddef.h> // operator new, size_t, NULL
|
2010-07-22 10:25:14 +00:00
|
|
|
|
|
|
|
// Function linkage
|
|
|
|
#define DLL_IMPORT
|
|
|
|
#if __GNUC__ >= 4
|
|
|
|
# define DLL_EXPORT __attribute__((visibility("default")))
|
|
|
|
# define DLL_EXPORT_CLASS DLL_EXPORT
|
|
|
|
#else
|
|
|
|
# define DLL_EXPORT
|
|
|
|
# define DLL_EXPORT_CLASS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Function calling modes
|
|
|
|
#if NV_CPU_X86
|
|
|
|
# define NV_CDECL __attribute__((cdecl))
|
|
|
|
# define NV_STDCALL __attribute__((stdcall))
|
|
|
|
#else
|
|
|
|
# define NV_CDECL
|
|
|
|
# define NV_STDCALL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define NV_FASTCALL __attribute__((fastcall))
|
2013-02-05 18:35:38 +00:00
|
|
|
#define NV_FORCEINLINE __attribute__((always_inline)) inline
|
2010-07-22 10:25:14 +00:00
|
|
|
#define NV_DEPRECATED __attribute__((deprecated))
|
|
|
|
|
|
|
|
#if __GNUC__ > 2
|
|
|
|
#define NV_PURE __attribute__((pure))
|
|
|
|
#define NV_CONST __attribute__((const))
|
|
|
|
#else
|
|
|
|
#define NV_PURE
|
|
|
|
#define NV_CONST
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define NV_NOINLINE __attribute__((noinline))
|
|
|
|
|
|
|
|
// Define __FUNC__ properly.
|
|
|
|
#if __STDC_VERSION__ < 199901L
|
|
|
|
# if __GNUC__ >= 2
|
|
|
|
# define __FUNC__ __PRETTY_FUNCTION__ // __FUNCTION__
|
|
|
|
# else
|
|
|
|
# define __FUNC__ "<unknown>"
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# define __FUNC__ __PRETTY_FUNCTION__
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define restrict __restrict__
|
|
|
|
|
2010-09-20 06:58:20 +00:00
|
|
|
/*
|
2010-07-22 10:25:14 +00:00
|
|
|
// Type definitions
|
|
|
|
typedef uint8_t uint8;
|
|
|
|
typedef int8_t int8;
|
|
|
|
|
|
|
|
typedef uint16_t uint16;
|
|
|
|
typedef int16_t int16;
|
|
|
|
|
|
|
|
typedef uint32_t uint32;
|
|
|
|
typedef int32_t int32;
|
|
|
|
|
|
|
|
typedef uint64_t uint64;
|
|
|
|
typedef int64_t int64;
|
|
|
|
|
|
|
|
// Aliases
|
|
|
|
typedef uint32 uint;
|
2011-09-27 17:48:46 +00:00
|
|
|
*/
|