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 convention 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")))
80 # define xSTDCALL __attribute__ ((__stdcall__))
89 # define xCCALL __attribute__ ((__cdecl__))
91 #elif defined(__GNUC__) && (__GNUC__ >=4)
92 # define xNOEXPORT __attribute__ ((visibility ("hidden")))
93 # define xEXPORT __attribute__ ((visibility ("default")))
94 # define xIMPORT __attribute__ ((visibility ("default")))
99 # define xSTDCALL __attribute__ ((__stdcall__))
104 # define xCCALL __attribute__ ((__cdecl__))
110 #elif defined(__SUNPRO_CC)
111 # define xNOEXPORT __hidden
112 # define xEXPORT __global
117 #error "Unsupported/Unknown platform - unable to define function call and visibility defines"
120 #define P6NOEXPORT xNOEXPORT
121 #define P6EXPORT xEXPORT
122 #define P6IMPORT xIMPORT
123 #define P6STDCALL xSTDCALL
124 #define P6CCALL xCCALL
131 # define interface struct
157 # define P6IIDOF(iface) ((const P6R::P6IID) IF_##iface)
166 # define P6DECLARE_IID(iface) static const P6R::P6IID IID_##iface = IF_##iface
172 # define P6DECLARE_CID(component) static const P6R::P6CID CID_##component = COMP_##component
178 # define P6DECLARE_CATID(category) static const P6R::P6CATID CATID_##category = CAT_##category
180 # define P6COMMETHOD virtual P6NOEXPORT P6R::P6ERR P6STDCALL
181 # define P6COMMETHOD_(type) virtual P6NOEXPORT type P6STDCALL
182 # define P6COMMETHODIMPL P6NOEXPORT P6R::P6ERR
183 # define P6CLASSMETHOD P6NOEXPORT P6R::P6ERR P6STDCALL
184 # define P6CLASSMETHODIMPL P6NOEXPORT P6R::P6ERR
187 # define P6DECLAREIF(iface) interface iface
188 # define P6DECLAREIF_(iface,baseif) interface iface : public baseif
189 # define P6DECLCOMMETHOD(method) P6COMMETHOD method
190 # define P6DECLCOMMETHOD_(type,method) P6COMMETHOD_(type) method
191 # define P6DECLAREICOM
195 # define P6REFUUID P6R::P6UUID &
196 # define P6REFCID P6R::P6CID &
197 # define P6REFIID P6R::P6IID &
198 # define P6REFCATID P6R::P6CATID &
199 # define P6REFUINT32 P6R::P6UINT32 &
202 #define P6COMVAMETHOD virtual P6NOEXPORT P6R::P6ERR P6CCALL
204 #define P6COMVAMETHODIMPL P6NOEXPORT P6R::P6ERR P6CCALL
206 #define P6TEXT(t) L ## t
207 #define P6CTEXT(t) (const P6R::P6WCHAR*) L ## t
208 #define P6CCHR(c) (const P6R::P6WCHAR) L ## c
209 #define P6CHR(c) L ## c
210 #define P6CHARCNT(x) (sizeof((x))/sizeof((x)[0]))
211 #define P6CNTOF P6CHARCNT
238 # define P6ASSERT(expr) ((expr)?P6R::eOk:P6R::p6Assert(P6TEXT(#expr),__FILE__,__LINE__))
240 # define P6ASSERT(expr)
246 # define P6IIDOF(iface) ((const P6IID) IF_##iface)
247 # define P6DECLARE_IID(iface) static const P6IID IID_##iface = IF_##iface
248 # define P6DECLARE_CID(component) static const P6CID CID_##component = COMP_##component
249 # define P6DECLARE_CATID(category) static const P6CATID CATID_##category = CAT_##category
251 # define P6COMMETHOD P6ERR P6STDCALL
252 # define P6COMMETHOD_(type) type P6STDCALL
253 # define P6COMMETHODIMPL P6ERR
255 # define P6DECLCOMMETHOD(method) P6ERR (P6STDCALL *method)
256 # define P6DECLCOMMETHOD_(type,method) type (P6STDCALL *method)
258 # define P6THIS_ INTERFACE * This,
259 # define P6THIS INTERFACE * This
260 # define P6REFUUID P6UUID *
261 # define P6REFCID P6CID *
262 # define P6REFIID P6IID *
263 # define P6REFCATID P6CATID *
264 # define P6REFUINT32 P6UINT32 *
266 # define P6DECLAREIF(iface) typedef interface iface { \
267 struct iface##Vtbl * lpVtbl; \
269 typedef struct iface##Vtbl iface##Vtbl; \
272 # define P6DECLAREIF_(iface,baseif) P6DECLAREIF(iface)
274 # define P6DECLAREICOM P6DECLCOMMETHOD(queryInterface)(P6THIS_ const P6REFIID iid,P6VOID **ppIface) P6PURE; \
275 P6DECLCOMMETHOD_(P6INT32,addref)(P6THIS) P6PURE; \
276 P6DECLCOMMETHOD_(P6INT32,release)(P6THIS) P6PURE;
278 #define P6TEXT(t) L ## t
279 #define P6CTEXT(t) (const P6WCHAR*) L ## t
280 #define P6CCHR(c) (const P6WCHAR) L ## c
281 #define P6CHR(c) L ## c
282 #define P6CHARCNT(x) (sizeof((x))/sizeof((x)[0]))
283 #define P6CNTOF P6CHARCNT
286 # define P6ASSERT(expr) ((expr)?eOk:p6Assert(P6TEXT(#expr),__FILE__,__LINE__))
288 # define P6ASSERT(expr)
291 #endif // __cplusplus
299 # define NULL ((void *)0)
304 #ifndef P6CURFUNCTION
306 #define P6CURFUNCTION __FUNCTION__
308 #define P6CURFUNCTION __func__