Project

General

Profile

Statistics
| Branch: | Revision:

root / include / platdep / platdefs.h @ fbe00e73

History | View | Annotate | Download (1.94 KB)

1
//==========================================================================
2
//  PLATDEFS.H - part of
3
//                     OMNeT++/OMNEST
4
//            Discrete System Simulation in C++
5
//
6
//
7
//  Compiler and platform related checks and defines
8
//
9
//==========================================================================
10

    
11
/*--------------------------------------------------------------*
12
  Copyright (C) 1992-2008 Andras Varga
13
  Copyright (C) 2006-2008 OpenSim Ltd.
14

15
  This file is distributed WITHOUT ANY WARRANTY. See the file
16
  `license' for details on this and other legal matters.
17
*--------------------------------------------------------------*/
18

    
19
#ifndef __PLATDEFS_H
20
#define __PLATDEFS_H
21

    
22
#include <stddef.h>
23

    
24
#ifndef _WIN32
25
#  if defined(_WIN32) || defined(WIN32) || defined(__WIN32__)
26
#    define _WIN32
27
#  endif
28
#endif
29

    
30
// macros needed for building Windows DLLs
31
#if defined(_WIN32)
32
#  define OPP_DLLEXPORT  __declspec(dllexport)
33
#  define OPP_DLLIMPORT  __declspec(dllimport)
34
#else
35
#  define OPP_DLLIMPORT
36
#  define OPP_DLLEXPORT
37
#endif
38

    
39
// check VC++ version (6.0 is no longer accepted)
40
#ifdef _MSC_VER
41
#if _MSC_VER<1300
42
#error "OMNEST/OMNeT++ cannot be compiled with Visual C++ 6.0 or earlier, at least version 7.0 required"
43
#endif
44
#endif
45

    
46
#ifdef _MSC_VER
47
#pragma warning(disable:4800)  // disable "forcing int to bool"
48
#endif
49

    
50
// gcc 2.9x.x had broken exception handling
51
#ifdef __GNUC__
52
#  if  __GNUC__<3
53
#    error gcc 3.x or later required -- please upgrade
54
#  endif
55
#endif
56

    
57
#if defined __GNUC__ && __GNUC__>=4
58
#define _OPPDEPRECATED __attribute((__deprecated__))
59
#elif defined _MSC_VER
60
#define _OPPDEPRECATED __declspec(deprecated)
61
#else
62
#define _OPPDEPRECATED
63
#endif
64

    
65
#ifdef USE_NAMESPACE
66
#  define NAMESPACE_BEGIN  namespace omnetpp {
67
#  define NAMESPACE_END    };
68
#  define USING_NAMESPACE  using namespace omnetpp;
69
#  define OPP              omnetpp
70
#else
71
#  define NAMESPACE_BEGIN
72
#  define NAMESPACE_END
73
#  define USING_NAMESPACE
74
#  define OPP
75
#endif
76

    
77
#endif
78