simkerneldefs.h

00001 //==========================================================================
00002 //  SIMKERNELDEFS.H - part of
00003 //                     OMNeT++/OMNEST
00004 //            Discrete System Simulation in C++
00005 //
00006 //
00007 //  Defines of for the simulation kernel
00008 //
00009 //==========================================================================
00010 
00011 /*--------------------------------------------------------------*
00012   Copyright (C) 1992-2008 Andras Varga
00013   Copyright (C) 2006-2008 OpenSim Ltd.
00014 
00015   This file is distributed WITHOUT ANY WARRANTY. See the file
00016   `license' for details on this and other legal matters.
00017 *--------------------------------------------------------------*/
00018 
00019 #ifndef __SIMKERNELDEFS_H
00020 #define __SIMKERNELDEFS_H
00021 
00022 #include <stddef.h>
00023 #include <float.h>
00024 #include <math.h>
00025 #include "platdep/platdefs.h"
00026 #include "platdep/intxtypes.h"
00027 
00028 // OMNeT++ version -- must match NEDC_VERSION and MSGC_VERSION in nedxml
00029 #define OMNETPP_VERSION 0x0406
00030 
00031 #if defined(SIM_EXPORT)
00032 #  define SIM_API OPP_DLLEXPORT
00033 #elif defined(SIM_IMPORT) || defined(OMNETPPLIBS_IMPORT)
00034 #  define SIM_API OPP_DLLIMPORT
00035 #else
00036 #  define SIM_API
00037 #endif
00038 
00039 // NULL
00040 #ifndef NULL
00041 #define NULL 0
00042 #endif
00043 
00044 //
00045 // WITHOUT_CPACKET turns on a compatibility mode, where older models that use
00046 // cMessage instead of cMessage for network packets can be compiled; this
00047 // feature may make porting existing models to 4.0 easier.
00048 //
00049 #ifdef WITHOUT_CPACKET
00050 #define cMessage cPacket
00051 #endif
00052 
00053 //
00054 // other common defines
00055 //
00056 
00057 #ifndef PI
00058 #define PI        3.141592653589793
00059 #endif
00060 
00061 #ifndef NDEBUG
00062 #define ASSERT(expr) \
00063   ((void) ((expr) ? 0 : (opp_error("ASSERT: condition %s false in function %s, %s line %d", \
00064                                    #expr, __FUNCTION__, __FILE__, __LINE__), 0)))
00065 #define ASSERT2(expr,text) \
00066   ((void) ((expr) ? 0 : (opp_error("ASSERT: %s in function %s, %s line %d", \
00067                                    text, __FUNCTION__, __FILE__, __LINE__), 0)))
00068 #else
00069 #define ASSERT(expr)        ((void)0)
00070 #define ASSERT2(expr,text)  ((void)0)
00071 #endif
00072 
00073 
00074 typedef int64 eventnumber_t;
00075 
00076 
00082 typedef void (*VoidDelFunc)(void *);
00083 
00089 typedef void *(*VoidDupFunc)(void *);
00090 
00091 
00092 #endif
00093 
Generated on Tue Dec 2 11:16:27 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3