summaryrefslogtreecommitdiff
path: root/thirdparty/thekla_atlas/nvcore/DefsGnucDarwin.h
blob: afb21c3d25fe31379b72aafe53a6f2b332142ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef NV_CORE_H
#error "Do not include this file directly."
#endif

#include <stdint.h> // uint8_t, int8_t, ... uintptr_t
#include <stddef.h> // operator new, size_t, NULL

// 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))
#define NV_FORCEINLINE	__attribute__((always_inline)) inline
#define NV_DEPRECATED   __attribute__((deprecated))
#if NV_OS_IOS
#define NV_THREAD_LOCAL // @@ IC: Looks like iOS does not have support for TLS declarations.
#else
#define NV_THREAD_LOCAL __thread
#endif

#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__