Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > contrib-release > by-pkgid > 24b00a2a0eb5a285df26cd26c1ede933 > files > 19

lib64rlog1-devel-1.3.7-2mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>rlog: common.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.3 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000001.html">rlog-1.3.7</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000002.html">rlog</a></div>
<h1>1.3.7/rlog/common.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> * Author:   Valient Gough &lt;vgough@pobox.com&gt;</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> *****************************************************************************</span>
<a name="l00005"></a>00005 <span class="comment"> * Copyright (c) 2002-2004, Valient Gough</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can distribute it and/or modify it under</span>
<a name="l00008"></a>00008 <span class="comment"> * the terms of the GNU Lesser General Public License (LGPL), as published by</span>
<a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; either version 2.1 of the License, or (at your</span>
<a name="l00010"></a>00010 <span class="comment"> * option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful, but WITHOUT</span>
<a name="l00013"></a>00013 <span class="comment"> * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
<a name="l00014"></a>00014 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE.  See the LGPL in the file COPYING for more</span>
<a name="l00015"></a>00015 <span class="comment"> * details.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> */</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef _rlogconfig_incl_</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define _rlogconfig_incl_</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="comment">/*</span>
<a name="l00028"></a>00028 <span class="comment">    Defined by configure if our compiler allows us to specify printf attributes</span>
<a name="l00029"></a>00029 <span class="comment">    on a function pointer..  Newer versions of GCC allow this, but older ones</span>
<a name="l00030"></a>00030 <span class="comment">    do not..</span>
<a name="l00031"></a>00031 <span class="comment">*/</span>
<a name="l00032"></a>00032 <span class="preprocessor">#define HAVE_PRINTF_FP 1</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="comment">/*</span>
<a name="l00035"></a>00035 <span class="comment">    Defined by configure if our compiler understands VARIADAC macros.</span>
<a name="l00036"></a>00036 <span class="comment">*/</span>
<a name="l00037"></a>00037 <span class="preprocessor">#define C99_VARIADAC_MACROS 1</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define PREC99_VARIADAC_MACROS 1</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="preprocessor">#define RLOG_TIME_TSC 1</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>
<a name="l00042"></a>00042 <span class="comment">/*</span>
<a name="l00043"></a>00043 <span class="comment">    We use __printf__ attribute to allow gcc to inspect printf style arguments</span>
<a name="l00044"></a>00044 <span class="comment">    and give warnings if the rDebug(), rWarning(), etc macros are misused.</span>
<a name="l00045"></a>00045 <span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment">    We use __builtin_expect on GCC 2.96 and above to allow optimization of</span>
<a name="l00047"></a>00047 <span class="comment">    publication activation check.  We tell the compiler that the branch is</span>
<a name="l00048"></a>00048 <span class="comment">    unlikely to occur, allowing GCC to push unecessary code out of the main</span>
<a name="l00049"></a>00049 <span class="comment">    path.</span>
<a name="l00050"></a>00050 <span class="comment">*/</span>
<a name="l00051"></a>00051 <span class="preprocessor">#ifdef __GNUC__</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span>
<a name="l00053"></a>00053 <span class="preprocessor"># define PRINTF(FMT,X) __attribute__ (( __format__ ( __printf__, FMT, X)))</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor"># define HAVE_PRINTF_ATTR 1</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056 <span class="preprocessor"># if !defined( __builtin_expect )</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#  define __builtin_expect(x,expected_value) (x)</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor"># endif</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a>00060 <span class="preprocessor"># define   likely(x)  __builtin_expect((x),1)</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor"># define unlikely(x)  __builtin_expect((x),0)</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span>
<a name="l00063"></a>00063 <span class="preprocessor">#else</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span>
<a name="l00065"></a>00065 <span class="comment">// Not using the gcc compiler, make the macros do nothing..  They are</span>
<a name="l00066"></a>00066 <span class="comment">// documented as the last instance of the macros..</span>
<a name="l00067"></a>00067 
<a name="l00075"></a>00075 <span class="preprocessor"># define PRINTF(FMT,X)</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor"># define HAVE_PRINTF_ATTR 0</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00079"></a>00079 <span class="preprocessor"># define   likely(x)  (x)</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span>
<a name="l00086"></a>00086 <span class="preprocessor"># define unlikely(x)  (x)</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span>
<a name="l00088"></a>00088 <span class="preprocessor">#endif</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span>
<a name="l00090"></a>00090 <span class="preprocessor">#if HAVE_PRINTF_FP</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor"># define PRINTF_FP(FMT,X) PRINTF(FMT,X)</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor"># define PRINTF_FP(FMT,X)</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>
<a name="l00104"></a>00104 <span class="preprocessor">#ifndef RLOG_COMPONENT</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#  warning RLOG_COMPONENT not defined - setting to UNKNOWN</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#define RLOG_COMPONENT "[unknown]"</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#endif // RLOG_COMPONENT not defined</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span>
<a name="l00109"></a>00109 <span class="comment">// Use somewhat unique names (doesn't matter if they aren't as they are used in</span>
<a name="l00110"></a>00110 <span class="comment">// a private context, so the compiler will make them unique if it must)</span>
<a name="l00111"></a>00111 <span class="preprocessor">#  define LOGID CONCAT(_rL_, __LINE__)</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00113"></a>00113 <span class="preprocessor">#define RLOG_DECL</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span>
<a name="l00115"></a>00115 <span class="preprocessor">#endif // _rlogconfig_incl_</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Oct 5 11:13:40 2005 for rlog by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.3 </small></address>
</body>
</html>