S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_macros.h

Go to the documentation of this file.
00001 /*
00002  * Stone Three Foundation Class (s3fc) provides a number of utility classes.
00003  * Copyright (C) 2001 by Stone Three Signal Processing (Pty) Ltd.
00004  *
00005  * Authored by Stone Three Signal Processing (Pty) Ltd.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  * 
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  * 
00021  * Please see the file 'COPYING' in the source root directory.
00022  */
00023 
00024 #ifndef S3_MACROS_H
00025 #define S3_MACROS_H
00026 
00027 // remove const qualification from mutex pointer
00028 #ifndef NONCONST_MUTEXP
00029 #define NONCONST_MUTEXP(x) ( const_cast<pthread_mutex_t*>(x) )
00030 #endif
00031 
00032 
00042 #ifndef CONST_OVERRIDE_THIS
00043 #define CONST_OVERRIDE_THIS(x) const_cast<x*>(this)-> 
00044 #endif
00045 
00046 
00047 #ifdef S3_VERBOSE_DEBUG
00048 #define S3FC_DBG(x)  x ;
00049 #define S3FC_DBG_(x) std::cerr << x << std::endl << std::flush;
00050 #define S3FC_DBG2_(x,y) std::cerr << x << ": " << y << std::endl << std::flush;
00051 #else
00052 #define S3FC_DBG(x)
00053 #define S3FC_DBG_(x)
00054 #define S3FC_DBG2_(x,y)
00055 #endif
00056 
00057 /*
00058  * Debug aids.
00059  */
00060 
00062 #ifndef S3_DEBUG_LEVEL
00063 #define S3_DEBUG_LEVEL (5)
00064 #endif
00065 
00071 #ifdef S3_VERBOSE_DEBUG
00072 #define S3FC_DBGL(x, l) if (l >= S3_DEBUG_LEVEL) x 
00073 #else
00074 #define S3FC_DBGL(x, l)
00075 #endif
00076 
00077 #ifdef __GNUC__
00078 #define S3_ATTR_NOCHECK_MEMORY_USAGE __attribute__ ((no_check_memory_usage))
00079 #else
00080 #define S3_ATTR_NOCHECK_MEMORY_USAGE
00081 #endif
00082 
00083 // this is shaky and would come apart if some BSD library declares
00084 // INVALID_SOCKET as a typed constant instead of using a define
00085 // we add it here because Linux does not have INVALID_SOCKET
00086 #ifndef _WIN32
00087 #ifndef INVALID_SOCKET
00088 #define INVALID_SOCKET ((int) -1)
00089 #endif
00090 #endif
00091 
00092 const char* s3fc_get_version();
00093 
00094 
00095 #endif  // S3_MACROS_H

Send comments to: s3fc@stonethree.com SourceForge Logo