Synopsis - Cross-Reference

File: /Synopsis/Parsers/IDL/idlsysdep.h
  1// -*- c++ -*-
  2//                          Package   : omniidl
  3// idlsysdep.h              Created on: 1999/11/04
  4//			    Author    : Duncan Grisby (dpg1)
  5//
  6//    Copyright (C) 1999 AT&T Laboratories Cambridge
  7//
  8//  This file is part of omniidl.
  9//
 10//  omniidl is free software; you can redistribute it and/or modify it
 11//  under the terms of the GNU General Public License as published by
 12//  the Free Software Foundation; either version 2 of the License, or
 13//  (at your option) any later version.
 14//
 15//  This program is distributed in the hope that it will be useful,
 16//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 17//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 18//  General Public License for more details.
 19//
 20//  You should have received a copy of the GNU General Public License
 21//  along with this program; if not, write to the Free Software
 22//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 23//  02111-1307, USA.
 24//
 25// Description:
 26//   
 27//   System dependencies
 28
 29// $Id: idlsysdep.h,v 1.8.2.2 2005/01/06 23:11:14 dgrisby Exp $
 30// $Log: idlsysdep.h,v $
 31// Revision 1.8.2.2  2005/01/06 23:11:14  dgrisby
 32// Big merge from omni4_0_develop.
 33//
 34// Revision 1.8.2.1  2003/03/23 21:01:44  dgrisby
 35// Start of omniORB 4.1.x development branch.
 36//
 37// Revision 1.4.2.5  2002/02/01 11:22:06  dpg1
 38// strcasecmp/stricmp redefinition on Windows.
 39//
 40// Revision 1.4.2.4  2002/01/15 16:38:14  dpg1
 41// On the road to autoconf. Dependencies refactored, configure.ac
 42// written. No makefiles yet.
 43//
 44// Revision 1.4.2.3  2001/06/08 17:12:24  dpg1
 45// Merge all the bug fixes from omni3_develop.
 46//
 47// Revision 1.4.2.2  2000/10/27 16:31:10  dpg1
 48// Clean up of omniidl dependencies and types, from omni3_develop.
 49//
 50// Revision 1.4.2.1  2000/07/17 10:36:05  sll
 51// Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0.
 52//
 53// Revision 1.5  2000/07/13 15:25:52  dpg1
 54// Merge from omni3_develop for 3.0 release.
 55//
 56// Revision 1.2  1999/11/09 12:41:40  dpg1
 57// strcasecmp changes for NT, AIX.
 58//
 59// Revision 1.1  1999/11/05 09:43:01  dpg1
 60// Changes for NT.
 61//
 62
 63#ifndef _idlsysdep_h_
 64#define _idlsysdep_h_
 65
 66// #define USE_omniORB_logStream
 67// #include <omniORB4/CORBA_sysdep.h>
 68#include <config.h>
 69
 70
 71// As usual, Windows manages to be different...
 72#ifdef __WIN32__
 73// declspec is a define in windef.h under MINGW
 74#ifdef __MINGW32__
 75#  define DLL_EXPORT __attribute__((dllexport))
 76#else
 77#  define DLL_EXPORT _declspec(dllexport)
 78#endif
 79#else
 80#  define DLL_EXPORT
 81#  include <strings.h>
 82#endif
 83
 84
 85#ifdef HAS_Cplusplus_Bool
 86typedef bool                      IDL_Boolean;
 87#else
 88typedef unsigned char             IDL_Boolean;
 89#endif
 90
 91typedef unsigned char             IDL_Char;
 92
 93typedef unsigned char             IDL_Octet;
 94
 95typedef short                     IDL_Short;
 96
 97typedef unsigned short            IDL_UShort;
 98
 99typedef unsigned short            IDL_WChar;
100
101#if SIZEOF_LONG == 4
102typedef long                      IDL_Long;
103
104typedef unsigned long             IDL_ULong;
105#elif SIZEOF_INT == 4
106typedef int                       IDL_Long;
107
108typedef unsigned int              IDL_ULong;
109#else
110# error "Can't map Long (32 bits) to a native type."
111#endif
112
113#ifdef HAS_LongLong
114typedef _CORBA_LONGLONG_DECL      IDL_LongLong;
115typedef _CORBA_ULONGLONG_DECL     IDL_ULongLong;
116#endif
117
118
119#ifndef NO_FLOAT
120
121#ifndef __VAX
122
123// This platform uses IEEE float
124typedef float                     IDL_Float;
125typedef double                    IDL_Double;
126
127#ifdef HAS_LongDouble
128typedef _CORBA_LONGDOUBLE_DECL    IDL_LongDouble;
129#endif
130
131#else	// VAX float test
132
133// VAX uses proxies for float.
134#define USING_PROXY_FLOAT
135
136class IDL_Float {
137  IDL_Long pd_f;
138  void cvt_(float f);
139  float cvt_() const;
140public:
141  // using compiler generated copy constructor and copy assignment
142  inline IDL_Float() {cvt_(0.0f);}
143  inline IDL_Float(float f) {cvt_(f);}
144  inline operator float() const {return cvt_();}
145};
146
147class IDL_Double {
148  IDL_Long pd_d[2];
149  void cvt_(double d);
150  double cvt_() const;
151public:
152  // using compiler generated copy constructor and copy assignment
153  inline IDL_Double() {cvt_(0.0);}
154  inline IDL_Double(double d) {cvt_(d);}
155  inline operator double() const {return cvt_();}
156};
157
158#undef cvt_
159
160//  Assume long double type is compatible with the CORBA standard.
161
162#ifdef HAS_LongDouble
163typedef _CORBA_LONGDOUBLE_DECL    IDL_LongDouble;
164#endif
165
166#endif   // VAX float test
167#endif   // !defined(NO_FLOAT)
168
169
170#endif // _idlsysdep_h_