Go to the documentation of this file.
19 #define P6MACROSTRING2(x) #x
20 #define P6MACROVALUE(x) P6MACROSTRING2(x)
28 #define P6UNUSED(x) x;
33 #define P6INVALIDTHREADID ((P6R::P6THREADID)0)
35 #define P6MIN(a,b) (((a) < (b)) ? (a) : (b))
36 #define P6MAX(a,b) (((a) > (b)) ? (a) : (b))
38 #define P6WAITINFINITE (P6R::P6INTERVAL)-1
39 #define P6WAITNONE (P6R::P6INTERVAL)0
41 #define P6MAXPATH 4096
42 #define P6MAXHOSTNAME 1025
43 #define P6MAXOSNAMESTR 128
44 #define P6MAXVERSIONSTR 1024
45 #define P6MAXARCHSTR 64
46 #define P6MAXIPADDR 46
47 #define P6MAX_PASS 1024
49 #define P6FILE __FILE__
50 #define P6LINE __LINE__
51 #define P6FILEANDLINE __FILE__,__LINE__
56 # define xEXPORT __declspec(dllexport)
57 # define xIMPORT __declspec(dllimport)
60 # elif defined(_M_IX86)
62 # define xEXPORT __declspec(dllexport)
63 # define xIMPORT __declspec(dllimport)
64 # define xSTDCALL __stdcall
65 # define xCCALL __cdecl
67 # error "Unsupported/Unknown Windows platform - unable to define calling convebtion and visibility macros."
69 #elif defined(__GNUC__) && ((__GNUC__ ==3) && (__GNUC_MINOR__ >= 4) && (__GNUC_PATCHLEVEL__ >= 4))
70 # define xNOEXPORT __attribute__ ((visibility ("hidden")))
71 # define xEXPORT __attribute__ ((visibility ("default")))
72 # define xIMPORT __attribute__ ((visibility ("default")))
77 # define xSTDCALL __attribute__ ((__stdcall__))
82 # define xCCALL __attribute__ ((__cdecl__))
83 #elif defined(__GNUC__) && (__GNUC__ ==4)
84 # define xNOEXPORT __attribute__ ((visibility ("hidden")))
85 # define xEXPORT __attribute__ ((visibility ("default")))
86 # define xIMPORT __attribute__ ((visibility ("default")))
88 # define xSTDCALL __attribute__ ((__stdcall__))
89 # define xCCALL __attribute__ ((__cdecl__))
94 #elif defined(__SUNPRO_CC)
95 # define xNOEXPORT __hidden
96 # define xEXPORT __global
101 #error "Unsupported/Unknown platform - unable to define function call and visibility defines"
104 #define P6NOEXPORT xNOEXPORT
105 #define P6EXPORT xEXPORT
106 #define P6IMPORT xIMPORT
107 #define P6STDCALL xSTDCALL
108 #define P6CCALL xCCALL
115 # define interface struct
141 # define P6IIDOF(iface) ((const P6R::P6IID) IF_##iface)
150 # define P6DECLARE_IID(iface) static const P6R::P6IID IID_##iface = IF_##iface
156 # define P6DECLARE_CID(component) static const P6R::P6CID CID_##component = COMP_##component
162 # define P6DECLARE_CATID(category) static const P6R::P6CATID CATID_##category = CAT_##category
164 # define P6COMMETHOD virtual P6NOEXPORT P6R::P6ERR P6STDCALL
165 # define P6COMMETHOD_(type) virtual P6NOEXPORT type P6STDCALL
166 # define P6COMMETHODIMPL P6NOEXPORT P6R::P6ERR
167 # define P6CLASSMETHOD P6NOEXPORT P6R::P6ERR P6STDCALL
168 # define P6CLASSMETHODIMPL P6NOEXPORT P6R::P6ERR
171 # define P6DECLAREIF(iface) interface iface
172 # define P6DECLAREIF_(iface,baseif) interface iface : public baseif
173 # define P6DECLCOMMETHOD(method) P6COMMETHOD method
174 # define P6DECLCOMMETHOD_(type,method) P6COMMETHOD_(type) method
175 # define P6DECLAREICOM
179 # define P6REFUUID P6R::P6UUID &
180 # define P6REFCID P6R::P6CID &
181 # define P6REFIID P6R::P6IID &
182 # define P6REFCATID P6R::P6CATID &
183 # define P6REFUINT32 P6R::P6UINT32 &
186 #define P6COMVAMETHOD virtual P6NOEXPORT P6R::P6ERR P6CCALL
188 #define P6COMVAMETHODIMPL P6NOEXPORT P6R::P6ERR P6CCALL
190 #define P6TEXT(t) L ## t
191 #define P6CTEXT(t) (const P6R::P6WCHAR*) L ## t
192 #define P6CCHR(c) (const P6R::P6WCHAR) L ## c
193 #define P6CHR(c) L ## c
194 #define P6CHARCNT(x) (sizeof((x))/sizeof((x)[0]))
195 #define P6CNTOF P6CHARCNT
222 # define P6ASSERT(expr) ((expr)?P6R::eOk:P6R::p6Assert(P6TEXT(#expr),__FILE__,__LINE__))
224 # define P6ASSERT(expr)
230 # define P6IIDOF(iface) ((const P6IID) IF_##iface)
231 # define P6DECLARE_IID(iface) static const P6IID IID_##iface = IF_##iface
232 # define P6DECLARE_CID(component) static const P6CID CID_##component = COMP_##component
233 # define P6DECLARE_CATID(category) static const P6CATID CATID_##category = CAT_##category
235 # define P6COMMETHOD P6ERR P6STDCALL
236 # define P6COMMETHOD_(type) type P6STDCALL
237 # define P6COMMETHODIMPL P6ERR
239 # define P6DECLCOMMETHOD(method) P6ERR (P6STDCALL *method)
240 # define P6DECLCOMMETHOD_(type,method) type (P6STDCALL *method)
242 # define P6THIS_ INTERFACE * This,
243 # define P6THIS INTERFACE * This
244 # define P6REFUUID P6UUID *
245 # define P6REFCID P6CID *
246 # define P6REFIID P6IID *
247 # define P6REFCATID P6CATID *
248 # define P6REFUINT32 P6UINT32 *
250 # define P6DECLAREIF(iface) typedef interface iface { \
251 struct iface##Vtbl * lpVtbl; \
253 typedef struct iface##Vtbl iface##Vtbl; \
256 # define P6DECLAREIF_(iface,baseif) P6DECLAREIF(iface)
258 # define P6DECLAREICOM P6DECLCOMMETHOD(queryInterface)(P6THIS_ const P6REFIID iid,P6VOID **ppIface) P6PURE; \
259 P6DECLCOMMETHOD_(P6INT32,addref)(P6THIS) P6PURE; \
260 P6DECLCOMMETHOD_(P6INT32,release)(P6THIS) P6PURE;
262 #define P6TEXT(t) L ## t
263 #define P6CTEXT(t) (const P6WCHAR*) L ## t
264 #define P6CCHR(c) (const P6WCHAR) L ## c
265 #define P6CHR(c) L ## c
266 #define P6CHARCNT(x) (sizeof((x))/sizeof((x)[0]))
267 #define P6CNTOF P6CHARCNT
270 # define P6ASSERT(expr) ((expr)?eOk:p6Assert(P6TEXT(#expr),__FILE__,__LINE__))
272 # define P6ASSERT(expr)
275 #endif // __cplusplus
283 # define NULL ((void *)0)