| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
| <title>oscl_base_macros.h Source File</title> |
| <link href="doxygen.css" rel="stylesheet" type="text/css"> |
| </head><body> |
| <!-- Generated by Doxygen 1.2.18 --> |
| <center> |
| <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> |
| <hr><h1>oscl_base_macros.h</h1><a href="oscl__base__macros_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span> |
| 00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> |
| 00003 |
| 00004 <span class="comment">// O S C L B A S E _ M A C R O S</span> |
| 00005 |
| 00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> |
| 00007 |
| 00018 <span class="preprocessor">#ifndef OSCL_BASE_MACROS_H_INCLUDED</span> |
| 00019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_BASE_MACROS_H_INCLUDED</span> |
| 00020 <span class="preprocessor"></span> |
| 00021 <span class="comment">// Pick up any platform-specific definitions for the common</span> |
| 00022 <span class="comment">// macros.</span> |
| 00023 <span class="preprocessor">#include "<a class="code" href="osclconfig_8h.html">osclconfig.h</a>"</span> |
| 00024 |
| 00025 <span class="comment">// Define default values for the common macros</span> |
| 00026 <span class="preprocessor">#ifndef OSCL_EXPORT_REF</span> |
| 00027 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_EXPORT_REF</span> |
| 00028 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00029 <span class="preprocessor"></span> |
| 00030 <span class="preprocessor">#ifndef OSCL_IMPORT_REF</span> |
| 00031 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_IMPORT_REF</span> |
| 00032 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00033 <span class="preprocessor"></span> |
| 00035 <span class="comment">//static const char NULL_TERM_CHAR = '\0';</span> |
| 00036 <span class="preprocessor">#ifndef NULL_TERM_CHAR</span> |
| <a name="l00037"></a><a class="code" href="group__osclbase.html#a80">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define NULL_TERM_CHAR '\0'</span> |
| 00038 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00039 <span class="preprocessor"></span> |
| 00041 <span class="preprocessor">#ifndef NULL</span> |
| <a name="l00042"></a><a class="code" href="group__osclbase.html#a81">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define NULL (0)</span> |
| 00043 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00044 <span class="preprocessor"></span> |
| 00045 <span class="preprocessor">#if (OSCL_DISABLE_INLINES)</span> |
| 00046 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_INLINE</span> |
| 00047 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_COND_EXPORT_REF OSCL_EXPORT_REF</span> |
| 00048 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_COND_IMPORT_REF OSCL_IMPORT_REF</span> |
| 00049 <span class="preprocessor"></span><span class="preprocessor">#else</span> |
| <a name="l00050"></a><a class="code" href="group__osclbase.html#a82">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_INLINE inline</span> |
| <a name="l00051"></a><a class="code" href="group__osclbase.html#a83">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_COND_EXPORT_REF</span> |
| <a name="l00052"></a><a class="code" href="group__osclbase.html#a84">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_COND_IMPORT_REF</span> |
| 00053 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00054 <span class="preprocessor"></span> |
| 00055 <span class="comment">//this macro may not be defined in all configurations</span> |
| 00056 <span class="comment">//so a default is defined here.</span> |
| 00057 |
| 00059 |
| <a name="l00064"></a><a class="code" href="group__osclbase.html#a85">00064</a> <span class="preprocessor">#define OSCL_CONST_CAST(type,exp) ((type)(exp))</span> |
| <a name="l00065"></a><a class="code" href="group__osclbase.html#a86">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_STATIC_CAST(type,exp) ((type)(exp))</span> |
| <a name="l00066"></a><a class="code" href="group__osclbase.html#a87">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_REINTERPRET_CAST(type,exp) ((type)(exp))</span> |
| <a name="l00067"></a><a class="code" href="group__osclbase.html#a88">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_DYNAMIC_CAST(type, exp) ((type)(exp))</span> |
| 00068 <span class="preprocessor"></span> |
| 00069 |
| <a name="l00084"></a><a class="code" href="group__osclbase.html#a89">00084</a> <span class="preprocessor">#define OSCL_UNUSED_ARG(vbl) (void)(vbl)</span> |
| <a name="l00085"></a><a class="code" href="group__osclbase.html#a90">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_UNUSED_RETURN(value) return value</span> |
| 00086 <span class="preprocessor"></span> |
| 00087 <span class="comment">/* The __TFS__ macro is used to optionally expand to "<>" depending on the</span> |
| 00088 <span class="comment"> * compiler. Some compilers require it to indicate that the friend function</span> |
| 00089 <span class="comment"> * is a template function as specified in the standard, but others don't</span> |
| 00090 <span class="comment"> * like it so it will handled with a macro expansion that depends on the</span> |
| 00091 <span class="comment"> * compiler.</span> |
| 00092 <span class="comment"> */</span> |
| 00093 <span class="preprocessor">#ifndef __TFS__</span> |
| 00094 <span class="preprocessor"></span><span class="preprocessor">#define __TFS__</span> |
| 00095 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00096 <span class="preprocessor"></span> |
| <a name="l00097"></a><a class="code" href="group__osclbase.html#a91">00097</a> <span class="preprocessor">#define OSCL_MIN(a,b) ((a) < (b) ? (a) : (b))</span> |
| <a name="l00098"></a><a class="code" href="group__osclbase.html#a92">00098</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_MAX(a,b) ((a) > (b) ? (a) : (b))</span> |
| <a name="l00099"></a><a class="code" href="group__osclbase.html#a93">00099</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_ABS(a) ((a) > (0) ? (a) : -(a))</span> |
| 00100 <span class="preprocessor"></span> |
| 00101 <span class="comment">// the syntax for explicitly calling the destructor varies on some platforms</span> |
| 00102 <span class="comment">// below is the default syntax as defined in the C++ standard</span> |
| 00103 <span class="preprocessor">#ifndef OSCL_TEMPLATED_DESTRUCTOR_CALL</span> |
| <a name="l00104"></a><a class="code" href="group__osclbase.html#a94">00104</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_TEMPLATED_DESTRUCTOR_CALL(type,simple_type) type :: ~simple_type ()</span> |
| 00105 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00106 <span class="preprocessor"></span> |
| 00107 |
| 00108 <span class="comment">/*</span> |
| 00109 <span class="comment"> * The OSCL_UNSIGNED_CONST macro is used to optionally add a suffix to the</span> |
| 00110 <span class="comment"> * end of integer constants to identify them as unsigned constants. It is</span> |
| 00111 <span class="comment"> * usually only necessary to do that for very large constants that are too</span> |
| 00112 <span class="comment"> * big to fit within the range of a signed integer. Some compilers will issue</span> |
| 00113 <span class="comment"> * warnings for that. The default behavior will be to add no suffix.</span> |
| 00114 <span class="comment"> */</span> |
| 00115 |
| 00116 <span class="preprocessor">#ifndef OSCL_UNSIGNED_CONST</span> |
| <a name="l00117"></a><a class="code" href="group__osclbase.html#a95">00117</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_UNSIGNED_CONST(x) x</span> |
| 00118 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00119 <span class="preprocessor"></span> |
| 00120 <span class="comment">/*</span> |
| 00121 <span class="comment"> * These macros are used by MTP to avoid byte aligning structures.</span> |
| 00122 <span class="comment"> */</span> |
| 00123 <span class="preprocessor">#ifndef OSCL_PACKED_VAR</span> |
| <a name="l00124"></a><a class="code" href="group__osclbase.html#a96">00124</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_PACKED_VAR "error"</span> |
| 00125 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00126 <span class="preprocessor"></span> |
| 00127 <span class="preprocessor">#ifndef OSCL_BEGIN_PACKED</span> |
| <a name="l00128"></a><a class="code" href="group__osclbase.html#a97">00128</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_BEGIN_PACKED "error"</span> |
| 00129 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00130 <span class="preprocessor"></span> |
| 00131 <span class="preprocessor">#ifndef OSCL_END_PACKED</span> |
| <a name="l00132"></a><a class="code" href="group__osclbase.html#a98">00132</a> <span class="preprocessor"></span><span class="preprocessor">#define OSCL_END_PACKED "error"</span> |
| 00133 <span class="preprocessor"></span><span class="preprocessor">#endif</span> |
| 00134 <span class="preprocessor"></span> |
| 00137 <span class="preprocessor">#endif // OSCL_BASE_MACROS_H_INCLUDED</span> |
| </pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> |
| <address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> |
| </small></address> |
| </body> |
| </html> |