📄 pport.h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--Syntax highlighting generated by Web C Plus Plus software v0.8.2Webcpp Copyright (C)2001, (C)2002, (C)2003 Jeffrey Bakker under the GNU GPLGet webcpp at http://webcpp.sf.net--><html><head><title>pport.h</title><style type="text/css">/*Webcpp v0.8.1 compatible StyleSheethttp://webcpp.sf.netTheme: ide-msvcpp*/body{background-color: #ffffff}.webcpp a:link {color:#000000}.webcpp a:visited {color:#008000}.webcpp a:active {color:#0000ff}.webcpp a:hover {color:#0000ff}.webcpp pre{color: #000000}.webcpp font{font-size:100%}.webcpp .symbols{color: #000000}.webcpp .preproc{color: #0000ff}.webcpp .integer{color: #000000}.webcpp .floatpt{color: #000000}.webcpp .dblquot{color: #000000}.webcpp .sinquot{color: #000000}.webcpp .keyword{color: #0000ff;}.webcpp .keytype{color: #0000ff;}.webcpp .comment{color: #008000;}</style></head><body bgcolor="#FFFFFF" leftmargin="40" marginwidth="40"> <p><a href="../htsrc.html">Index</a><hr noshade></p><div class="webcpp"><pre><font CLASS=preproc>#ifndef</font> __PPORT_H__ <font CLASS=preproc>#define</font> __PPORT_H__ <font CLASS=preproc>#if</font> defined(linux) <font CLASS=preproc>#</font> include <stdint.h> <font CLASS=comment>// for uintptr_t </font><font CLASS=preproc>#endif</font> <font CLASS=preproc>#include</font> <sys/types.h> <font CLASS=preproc>#ifndef</font> __cplusplus <font CLASS=preproc>#</font> error <font CLASS=dblquot>"This is a C++ source"</font> <font CLASS=preproc>#endif</font> <font CLASS=preproc>#define</font> PTYPES_NAMESPACE pt <font CLASS=comment>//</font><font CLASS=comment>// conditional namespace declarations</font><font CLASS=comment>//</font><font CLASS=preproc>#ifdef</font> PTYPES_NAMESPACE <font CLASS=preproc>#</font> define PTYPES_BEGIN <font CLASS=keyword>namespace</font> PTYPES_NAMESPACE { <font CLASS=preproc>#</font> define PTYPES_END } <font CLASS=preproc>#</font> define USING_PTYPES <font CLASS=keyword>using</font> <font CLASS=keyword>namespace</font> PTYPES_NAMESPACE; <font CLASS=preproc>#else</font> <font CLASS=preproc>#</font> define PTYPES_NAMESPACE <font CLASS=preproc>#</font> define PTYPES_BEGIN <font CLASS=preproc>#</font> define PTYPES_END <font CLASS=preproc>#</font> define USING_PTYPES <font CLASS=preproc>#endif</font> <font CLASS=comment>//</font><font CLASS=comment>// Windows DLL export/import and calling convention macros</font><font CLASS=comment>//</font><font CLASS=preproc>#ifdef</font> WIN32 <font CLASS=preproc>#</font> <font CLASS=keyword>if</font> defined(PTYPES_DLL_EXPORTS) <font CLASS=preproc>#</font> define ptpublic __declspec(dllexport) <font CLASS=preproc>#</font> elif defined(PTYPES_DLL) <font CLASS=preproc>#</font> define ptpublic __declspec(dllimport) <font CLASS=preproc>#</font> <font CLASS=keyword>else</font> <font CLASS=preproc>#</font> define <font CLASS=preproc>#</font> endif <font CLASS=preproc>#</font> define ptdecl __stdcall <font CLASS=preproc>#</font> define __PFASTCALL __fastcall <font CLASS=preproc>#else</font> <font CLASS=preproc>#</font> define ptpublic <font CLASS=preproc>#</font> define ptdecl <font CLASS=preproc>#</font> define __PFASTCALL <font CLASS=preproc>#endif</font> <font CLASS=comment>//</font><font CLASS=comment>// versioning</font><font CLASS=comment>//</font><font CLASS=keyword>extern</font> <font CLASS=dblquot>"C"</font> <font CLASS=keytype>unsigned</font> <font CLASS=keytype>long</font> __ptypes_version;<font CLASS=comment>// this enables outdated class names, such as exceptobj, tsemaphore, </font><font CLASS=comment>// ipsocket, ipserver, etc.</font><font CLASS=comment>// #define PTYPES18_COMPAT</font><font CLASS=comment>// this enables old algebraic list interfaces; NO_PTYPES19_COMPAT</font><font CLASS=comment>// can be defined at command line</font><font CLASS=preproc>#if</font> !defined(NO_PTYPES19_COMPAT) <font CLASS=preproc>#</font> define PTYPES19_COMPAT <font CLASS=preproc>#endif</font> PTYPES_BEGIN<font CLASS=preproc>#ifdef</font> _MSC_VER <font CLASS=comment>// we don't want "unreferenced inline function" warning</font><font CLASS=preproc>#</font> pragma warning (disable: <font CLASS=integer>4514</font>) <font CLASS=comment>// ... also "copy constructor/assignment operator could not be generated"</font><font CLASS=preproc>#</font> pragma warning (disable: <font CLASS=integer>4511</font>) <font CLASS=preproc>#</font> pragma warning (disable: <font CLASS=integer>4512</font>) <font CLASS=preproc>#endif</font> <font CLASS=preproc>#if</font> defined(_DEBUG) && !defined(DEBUG) <font CLASS=preproc>#</font> define DEBUG <font CLASS=preproc>#endif</font> <font CLASS=preproc>#if</font> defined(__WIN32__) && !defined(WIN32) <font CLASS=preproc>#</font> define WIN32 <font CLASS=preproc>#endif</font> <font CLASS=comment>// __APPLE__ is the only predefined macro on MacOS X</font><font CLASS=preproc>#if</font> defined(__APPLE__) <font CLASS=preproc>#</font> define __DARWIN__ <font CLASS=preproc>#endif</font> <font CLASS=comment>// CHECK_BOUNDS enables bounds checking for strings and lists</font><font CLASS=preproc>#if</font> defined(DEBUG) && !defined(CHECK_BOUNDS) <font CLASS=preproc>#</font> define CHECK_BOUNDS <font CLASS=preproc>#endif</font> <font CLASS=comment>// COUNT_OBJALLOC helps to keep track of the number of</font><font CLASS=comment>// objects created/destroyed</font><font CLASS=preproc>#if</font> defined(DEBUG) && !defined(COUNT_OBJALLOC) <font CLASS=preproc>#</font> define COUNT_OBJALLOC <font CLASS=preproc>#endif</font> <font CLASS=comment>//</font><font CLASS=comment>// useful typedefs</font><font CLASS=comment>//</font><font CLASS=keyword>typedef</font> <font CLASS=keytype>unsigned</font> <font CLASS=keytype>int</font> uint;<font CLASS=keyword>typedef</font> <font CLASS=keytype>unsigned</font> <font CLASS=keytype>long</font> ulong;<font CLASS=keyword>typedef</font> <font CLASS=keytype>unsigned</font> <font CLASS=keytype>short</font> ushort;<font CLASS=keyword>typedef</font> <font CLASS=keytype>unsigned</font> <font CLASS=keytype>char</font> uchar;<font CLASS=keyword>typedef</font> <font CLASS=keytype>signed</font> <font CLASS=keytype>char</font> schar;<font CLASS=keyword>typedef</font> <font CLASS=keytype>char</font>* pchar;<font CLASS=keyword>typedef</font> <font CLASS=keyword>const</font> <font CLASS=keytype>char</font>* pconst;<font CLASS=keyword>typedef</font> <font CLASS=keytype>void</font>* ptr;<font CLASS=keyword>typedef</font> <font CLASS=keytype>int</font>* pint;<font CLASS=preproc>#ifdef</font> WIN32 <font CLASS=keyword>typedef</font> uint pintptr;<font CLASS=preproc>#else</font> <font CLASS=keyword>typedef</font> uintptr_t pintptr;<font CLASS=preproc>#endif</font> <font CLASS=comment>//</font><font CLASS=comment>// portable 64-bit integers</font><font CLASS=comment>//</font><font CLASS=preproc>#if</font> defined(_MSC_VER) <font CLASS=symbols>||</font> defined(__BORLANDC__) <font CLASS=keyword>typedef</font> __int64 large; <font CLASS=keyword>typedef</font> <font CLASS=keytype>unsigned</font> __int64 ularge;<font CLASS=preproc>#</font> define LLCONST(a) (a##i64) <font CLASS=preproc>#else</font> <font CLASS=keyword>typedef</font> <font CLASS=keytype>long</font> <font CLASS=keytype>long</font> large; <font CLASS=keyword>typedef</font> <font CLASS=keytype>unsigned</font> <font CLASS=keytype>long</font> <font CLASS=keytype>long</font> ularge;<font CLASS=preproc>#</font> define LLCONST(a) (a##ll) <font CLASS=preproc>#endif</font> <font CLASS=preproc>#define</font> LARGE_MIN (LLCONST(<font CLASS=symbols>-</font><font CLASS=integer>9223372036854775807</font>)<font CLASS=symbols>-</font><font CLASS=integer>1</font>) <font CLASS=preproc>#define</font> LARGE_MAX (LLCONST(<font CLASS=integer>9223372036854775807</font>)) <font CLASS=preproc>#define</font> ULARGE_MAX (LLCONST(<font CLASS=integer>18446744073709551615</font>u)) <font CLASS=preproc>#if</font> defined(_MSC_VER) <font CLASS=symbols>||</font> defined(__BORLANDC__) <font CLASS=preproc>#</font> define strcasecmp stricmp <font CLASS=preproc>#</font> define snprintf _snprintf <font CLASS=preproc>#endif</font> <font CLASS=comment>//</font><font CLASS=comment>// misc.</font><font CLASS=comment>//</font><font CLASS=comment>// I like Pascal's nil</font><font CLASS=preproc>#define</font> nil <font CLASS=integer>0</font> <font CLASS=keyword>inline</font> <font CLASS=keytype>int</font> imax(<font CLASS=keytype>int</font> x, <font CLASS=keytype>int</font> y) { <font CLASS=keyword>return</font> (x > y) ? x : y; }<font CLASS=keyword>inline</font> <font CLASS=keytype>int</font> imin(<font CLASS=keytype>int</font> x, <font CLASS=keytype>int</font> y) { <font CLASS=keyword>return</font> (x < y) ? x : y; }<font CLASS=keyword>inline</font> large lmax(large x, large y) { <font CLASS=keyword>return</font> (x > y) ? x : y; }<font CLASS=keyword>inline</font> large lmin(large x, large y) { <font CLASS=keyword>return</font> (x < y) ? x : y; }<font CLASS=comment>//</font><font CLASS=comment>// critical error processing</font><font CLASS=comment>//</font><font CLASS=preproc>#define</font> CRIT_FIRST 0xC0000 <font CLASS=keyword>typedef</font> <font CLASS=keytype>void</font> (*_pcrithandler)(<font CLASS=keytype>int</font> code, <font CLASS=keyword>const</font> <font CLASS=keytype>char</font>* msg);_pcrithandler getcrithandler();_pcrithandler setcrithandler(_pcrithandler newh);<font CLASS=keytype>void</font> fatal(<font CLASS=keytype>int</font> code, <font CLASS=keyword>const</font> <font CLASS=keytype>char</font>* msg);<font CLASS=comment>//</font><font CLASS=comment>// memory management (undocumented)</font><font CLASS=comment>// hides some BSD* incompatibility issues</font><font CLASS=comment>//</font><font CLASS=keytype>void</font>* memalloc(uint a);<font CLASS=keytype>void</font>* memrealloc(<font CLASS=keytype>void</font>* p, uint a);<font CLASS=keytype>void</font> memfree(<font CLASS=keytype>void</font>* p);<font CLASS=keytype>void</font> memerror();<font CLASS=keytype>int</font> memquantize(<font CLASS=keytype>int</font>);PTYPES_END<font CLASS=preproc>#endif</font> <font CLASS=comment>// __PPORT_H__ </font></pre></div><hr noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -