Example
Loading...
Searching...
No Matches
CDefinesPrivate.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5// This is a private header with API internal defines. No need to directly use/include this header to your project.
6
7#include <Platforms.hpp>
8
9// Linkage macro.
10#if CC_PLATFORM_WIN
11#ifdef CL_DYNAMIC // in case we want a dynamic library
12#ifdef CL_EXPORT
13#define CL_DLL __declspec(dllexport)
14#else
15#define CL_DLL __declspec(dllimport)
16#endif
17#else // if static linkage, we don't export or import anything
18#define CL_DLL
19#endif
20#else // !CC_PLATFORM_WIN
21#define CL_DLL
22#endif
23
24#define CLC_STRUCT(Name) \
25 struct Name##d; \
26 typedef struct Name##d* Name
27
28#ifdef __cplusplus
29#include <cstdint>
30#define NOEXCEPT noexcept
31
32#define CLC_CLASS_WN(Wrapped, Name) \
33 namespace capsule::client { \
34 class Wrapped; \
35 } \
36 typedef class capsule::client::Wrapped* Name
37
38#define CLC_STRUCT_WN(Wrapped, Name) \
39 namespace capsule::client { \
40 struct Wrapped; \
41 } \
42 typedef struct capsule::client::Wrapped const* Name
43
44#define CLC_STRUCT_WNN(Wrapped, Name, Namespace) \
45 namespace capsule::Namespace { \
46 struct Wrapped; \
47 } \
48 typedef struct capsule::Namespace::Wrapped const* Name
49
50#else
51#include <stdint.h>
52#define NOEXCEPT
53
54#define CLC_CLASS_WN(Wrapped, Name) \
55 struct clCWrapped##d; \
56 typedef struct clCWrapped##d* Name
57
58#define CLC_STRUCT_WN(Wrapped, Name) \
59 struct clCWrapped##d; \
60 typedef struct clCWrapped##d const* Name
61
62#endif //__cplusplus