WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
webcface-config.h
Go to the documentation of this file.
1#pragma once
2
3#define WEBCFACE_STR(v) #v
4#define WEBCFACE_DEFAULT_PORT 7530
5#define WEBCFACE_DEFAULT_PORT_SI(port) WEBCFACE_STR(port)
6#define WEBCFACE_DEFAULT_PORT_S WEBCFACE_DEFAULT_PORT_SI(WEBCFACE_DEFAULT_PORT)
7#define WEBCFACE_SERVER_NAME "webcface"
8#define WEBCFACE_VERSION_MAJOR 2
9#define WEBCFACE_VERSION_MINOR 5
10#define WEBCFACE_VERSION_REVISION 2
11#define WEBCFACE_ABI_MAJOR 21
12#define WEBCFACE_VERSION "2.5.2"
13#define WEBCFACE_SHARED 1
14#define WEBCFACE_SYSTEM_DLLEXPORT 0
15#define WEBCFACE_SYSTEM_VISIBILITY 1
16#define WEBCFACE_SYSTEM_WCHAR_WINDOWS 0
17#define WEBCFACE_SYSTEM_WIN32SOCKET 0
18#define WEBCFACE_SYSTEM_PATH_WINDOWS 0
19#define WEBCFACE_SYSTEM_ADD_DEBUG 0
20#define WEBCFACE_EXP_FILESYSTEM 0
21#define WEBCFACE_PTR_SIZE 8
22
23// clang-format off
24/*
25WEBCFACE_DLL: 関数の宣言 (msvc, mingw, unix)
26WEBCFACE_DLL_TEMPLATE: テンプレートクラスの定義 (unix)
27WEBCFACE_DLL_INSTANCE_DECL: 明示的実体化の宣言 (msvc_import, mingw) (unixでは消す:gcc-10でエラー)
28WEBCFACE_DLL_INSTANCE_DEF: 明示的実体化の定義 (msvc_export, unix)
29
30*/
31// clang-format on
32
33#if WEBCFACE_SHARED
34#if WEBCFACE_SYSTEM_DLLEXPORT
35#ifdef WEBCFACE_BUILDING
36#ifdef _MSC_VER
37#define WEBCFACE_DLL __declspec(dllexport)
38#define WEBCFACE_DLL_TEMPLATE
39#define WEBCFACE_DLL_INSTANCE_DECL
40#define WEBCFACE_DLL_INSTANCE_DEF WEBCFACE_DLL
41#else // !_MSC_VER => on MinGW
42#define WEBCFACE_DLL __declspec(dllexport)
43#define WEBCFACE_DLL_TEMPLATE
44#define WEBCFACE_DLL_INSTANCE_DECL WEBCFACE_DLL
45#define WEBCFACE_DLL_INSTANCE_DEF
46#endif // _MSC_VER
47#else // !WEBCFACE_BUILDING
48#define WEBCFACE_DLL __declspec(dllimport)
49#define WEBCFACE_DLL_TEMPLATE
50#define WEBCFACE_DLL_INSTANCE_DECL WEBCFACE_DLL
51#define WEBCFACE_DLL_INSTANCE_DEF
52#endif // WEBCFACE_BUILDING
53#elif WEBCFACE_SYSTEM_VISIBILITY
54#ifdef WEBCFACE_BUILDING
55#define WEBCFACE_DLL __attribute__((visibility("default")))
56#define WEBCFACE_DLL_TEMPLATE WEBCFACE_DLL
57#undef WEBCFACE_DLL_INSTANCE_DECL
58#define WEBCFACE_DLL_INSTANCE_DEF WEBCFACE_DLL
59#else // !WEBCFACE_BUILDING
60#define WEBCFACE_DLL
61#define WEBCFACE_DLL_TEMPLATE
62#undef WEBCFACE_DLL_INSTANCE_DECL
63#define WEBCFACE_DLL_INSTANCE_DEF
64#endif // WEBCFACE_BUILDING
65#else // DLLEXPORT, VISIBILITY
66// clang-format off
67#error "neither WEBCFACE_SYSTEM_DLLEXPORT nor WEBCFACE_SYSTEM_VISIBILITY is defined"
68// clang-format on
69#endif
70#else // !WEBCFACE_SHARED
71#define WEBCFACE_DLL
72#define WEBCFACE_DLL_TEMPLATE
73#define WEBCFACE_DLL_INSTANCE_DECL
74#define WEBCFACE_DLL_INSTANCE_DEF
75#endif // WEBCFACE_SHARED
76
77// clang-format off
78/*
79calling convention
80
81通常の関数またはstaticメンバ関数(dllexportしているもの)につける。
82メンバ関数はthiscallなのでつけない
83std::function<>の中には要る(ただし型推論ができたりできなかったりする)
84ただしcygwinでstd::functionの中にcdecl宣言するとmanglingがおかしなことになった(なぜ?)
85関数ポインタには要る (typedef return_type (WEBCFACE_CALL *name)(args...); )
86
87*/
88// clang-format on
89#if WEBCFACE_SYSTEM_DLLEXPORT
90#define WEBCFACE_CALL __cdecl
91#ifdef __CYGWIN__
92#define WEBCFACE_CALL_FP
93#else
94#define WEBCFACE_CALL_FP WEBCFACE_CALL
95#endif
96#else // !DLLEXPORT
97#define WEBCFACE_CALL
98#define WEBCFACE_CALL_FP
99#endif
100
101// doxygenを生成するときは namespace webcface だけにする
102#ifdef WEBCFACE_DOXYGEN
103#define WEBCFACE_NS_BEGIN namespace webcface {
104#define WEBCFACE_NS_END }
105
106#else
107// コンパイル時にnamespaceにabiバージョンを埋め込む
108
109#if WEBCFACE_SYSTEM_ADD_DEBUG
110#ifdef _DEBUG
111#define WEBCFACE_NS_ABI_2(ver) v##ver##_debug
112#endif
113#endif
114
115#ifndef WEBCFACE_NS_ABI_2
116#define WEBCFACE_NS_ABI_2(ver) v##ver##_
117#endif
118
119#define WEBCFACE_NS_ABI(ver) WEBCFACE_NS_ABI_2(ver)
120#define WEBCFACE_NS_BEGIN \
121 namespace webcface { \
122 inline namespace WEBCFACE_NS_ABI(WEBCFACE_ABI_MAJOR) {
123#define WEBCFACE_NS_END \
124 } \
125 }
126
127#endif