1 // -*- c++ -*-
2 //                          Package   : omniidl
3 // idlsysdep.h              Created on: 1999/11/04
4 //			    Author    : Duncan Grisby (dpg1)
5 //
6 //    Copyright (C) 2005 Apasphere Ltd
7 //    Copyright (C) 1999 AT&T Laboratories Cambridge
8 //
9 //  This file is part of omniidl.
10 //
11 //  omniidl is free software; you can redistribute it and/or modify it
12 //  under the terms of the GNU General Public License as published by
13 //  the Free Software Foundation; either version 2 of the License, or
14 //  (at your option) any later version.
15 //
16 //  This program is distributed in the hope that it will be useful,
17 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 //  General Public License for more details.
20 //
21 //  You should have received a copy of the GNU General Public License
22 //  along with this program.  If not, see http://www.gnu.org/licenses/
23 //
24 // Description:
25 //
26 //   System dependencies
27 
28 #ifndef _idlsysdep_h_
29 #define _idlsysdep_h_
30 
31 #define USE_omniORB_logStream
32 #include <omniORB4/CORBA_sysdep.h>
33 
34 
35 // As usual, Windows manages to be different...
36 #ifdef __WIN32__
37 // declspec is a define in windef.h under MINGW
38 #ifdef __MINGW32__
39 #  define DLL_EXPORT __attribute__((dllexport))
40 #else
41 #  define DLL_EXPORT _declspec(dllexport)
42 #endif
43 #else
44 #  define DLL_EXPORT
45 #  include <strings.h>
46 #endif
47 
48 
49 #ifdef HAS_Cplusplus_Bool
50 typedef bool                      IDL_Boolean;
51 #else
52 typedef unsigned char             IDL_Boolean;
53 #endif
54 
55 typedef unsigned char             IDL_Char;
56 
57 typedef unsigned char             IDL_Octet;
58 
59 typedef short                     IDL_Short;
60 
61 typedef unsigned short            IDL_UShort;
62 
63 typedef unsigned short            IDL_WChar;
64 
65 #if SIZEOF_LONG == 4
66 typedef long                      IDL_Long;
67 
68 typedef unsigned long             IDL_ULong;
69 #elif SIZEOF_INT == 4
70 typedef int                       IDL_Long;
71 
72 typedef unsigned int              IDL_ULong;
73 #else
74 # error "Can't map Long (32 bits) to a native type."
75 #endif
76 
77 #ifdef HAS_LongLong
78 typedef _CORBA_LONGLONG_DECL      IDL_LongLong;
79 typedef _CORBA_ULONGLONG_DECL     IDL_ULongLong;
80 #endif
81 
82 
83 #ifndef NO_FLOAT
84 
85 #ifndef __VAX
86 
87 // This platform uses IEEE float
88 typedef float                     IDL_Float;
89 typedef double                    IDL_Double;
90 
91 #ifdef HAS_LongDouble
92 typedef _CORBA_LONGDOUBLE_DECL    IDL_LongDouble;
93 #endif
94 
95 #else	// VAX float test
96 
97 // VAX uses proxies for float.
98 #define USING_PROXY_FLOAT
99 
100 class IDL_Float {
101   IDL_Long pd_f;
102   void cvt_(float f);
103   float cvt_() const;
104 public:
105   // using compiler generated copy constructor and copy assignment
IDL_Float()106   inline IDL_Float() {cvt_(0.0f);}
IDL_Float(float f)107   inline IDL_Float(float f) {cvt_(f);}
108   inline operator float() const {return cvt_();}
109 };
110 
111 class IDL_Double {
112   IDL_Long pd_d[2];
113   void cvt_(double d);
114   double cvt_() const;
115 public:
116   // using compiler generated copy constructor and copy assignment
IDL_Double()117   inline IDL_Double() {cvt_(0.0);}
IDL_Double(double d)118   inline IDL_Double(double d) {cvt_(d);}
119   inline operator double() const {return cvt_();}
120 };
121 
122 #undef cvt_
123 
124 //  Assume long double type is compatible with the CORBA standard.
125 
126 #ifdef HAS_LongDouble
127 typedef _CORBA_LONGDOUBLE_DECL    IDL_LongDouble;
128 #endif
129 
130 #endif   // VAX float test
131 #endif   // !defined(NO_FLOAT)
132 
133 
134 #endif // _idlsysdep_h_
135