CCAux  2.17.0.0
CCAux API reference
CCPlatform.h
Go to the documentation of this file.
1 /************************************************
2 *
3 * CROSSCONTROL AUX API
4 *
5 * CCPlatform.h
6 *
7 * Version 2.17.0.0", 2019-10-22
8 *
9 * (c) CrossControl 2010-2019
10 *
11 
12  * File description:
13  * Platform dependent defines
14  *
15  ************************************************/
16 
17 #ifndef PLATFORM__H
18 #define PLATFORM__H
19 
20 //*****************************************************************************
21 // CALLING CONVENTION DEFINES
22 //*****************************************************************************
23 #ifdef __cplusplus
24 #ifndef EXTERN_C
25 # define EXTERN_C extern "C"
26 #endif // #ifndef EXTERN_C
27 #else
28 # define EXTERN_C
29 #endif
30 
31 #ifdef LINUX // Calling conventions
32 # define CCAUXDLL_API EXTERN_C
33 # define CCAUXDLL_CALLING_CONV
34 #else
35 # define CCAUXDLL_CALLING_CONV __stdcall
36 # if defined(CCAUXDLL_EXPORTS)
37 
38  #ifdef USE_DLL_EXPORT
39  #undef USE_DLL_EXPORT
40  #endif // #ifdef USE_DLL_EXPORT
41 
42  #ifdef USE_DLL_EXPORT
43  #define CCAUXDLL_API extern "C" __declspec(dllexport)
44  #else // #ifdef USE_DLL_EXPORT
45  #define CCAUXDLL_API extern "C"
46  #endif // #ifdef USE_DLL_EXPORT
47 
48 # else
49 # define CCAUXDLL_API __declspec(dllimport)
50 # endif
51 #endif
52 
53 #ifdef LINUX //Macros specifying ordinals for Win32
54 #define EXPORT_ORDINAL(ordinal)
55 #define EXPORT_ORDINAL_FUNCD(ordinal)
56 #else
57 // The below fix with extra spaces was not as simple it looks.
58 // Checkout this investigation: http://10.131.0.40/svn/generic_sw_components/api/branches/xm9_nemo/WinDbgTestApps/EXPORT_ORDINAL_WHEN_THE_FAT_LADY_SINGS/PragmaExportIssueApp
59 #define EXPORT_ORDINAL(ordinal) comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__ ",@" #ordinal)
60 #define EXPORT_ORDINAL_FUNCD(ordinal) comment(linker, "/EXPORT:" __FUNCDNAME__ ",@" #ordinal)
61 #endif
62 
63 //*****************************************************************************
64 // CHARACTER TYPE
65 //*****************************************************************************
66 #ifdef LINUX // string types
67 # include <wchar.h>
68 # if defined(_UNICODE) || defined(UNICODE)
69 # define LPCTSTR whcar_t const *
70 # define TCHAR wchar_t
71 # define _T(x) L ## x
72 # else
73 #ifndef LPCTSTR
74 # define LPCTSTR char_t const *
75 #endif
76 #ifndef TCHAR
77 # define TCHAR char_t
78 #endif
79 #ifndef _T
80 # define _T(x) x
81 #endif
82 # endif
83 #else
84 # include <wchar.h>
85 #endif
86 
87 #endif /* PLATFORM__H */
88