Re: Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-04 Thread Martin Spott
Martin Spott wrote:

 Would anyone object to a patch that unifies this to (__sun) ?

Patch1/3:

--- SimGear/simgear/compiler.h~ 2005-10-04 20:19:51.302671700 +0200
+++ SimGear/simgear/compiler.h  2005-10-04 20:19:51.322671800 +0200
@@ -324,7 +324,7 @@
 #endif // Native SGI compilers
 
 
-#if defined ( sun )
+#if defined (__sun)
 #  include strings.h
 #  include memory.h
 #  if defined ( __cplusplus )
--- SimGear/simgear/timing/sg_time.cxx~ 2005-10-04 20:20:10.222998350 +0200
+++ SimGear/simgear/timing/sg_time.cxx  2005-10-04 20:20:10.243047600 +0200
@@ -530,7 +530,7 @@
 #else // ! defined ( MK_TIME_IS_GMT )
 
 // timezone seems to work as a proper offset for Linux  Solaris
-#   if defined( __linux__ ) || defined( __sun__ ) ||defined(__CYGWIN__)
+#   if defined( __linux__ ) || defined(__sun) ||defined(__CYGWIN__)
 #   define TIMEZONE_OFFSET_WORKS 1
 #   endif


Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-04 Thread Martin Spott
Martin Spott wrote:

 Would anyone object to a patch that unifies this to (__sun) ?

Patch3/3:


--- TerraGear/src/BuildTiles/Parallel/server.cxx~   2005-10-04 
20:26:05.158702550 +0200
+++ TerraGear/src/BuildTiles/Parallel/server.cxx2005-10-04 
20:26:05.168701750 +0200
@@ -29,7 +29,7 @@
 SG_USING_STD( cerr );
 SG_USING_STD( endl );
 
-#if defined (sun) || defined (__CYGWIN__) || defined(sgi)
+#if defined (__sun) || defined (__CYGWIN__) || defined(sgi)
 #  define WAIT_ANY (pid_t)-1
 #endif


Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-04 Thread Martin Spott
Martin Spott wrote:

 Would anyone object to a patch that unifies this to (__sun) ?

Patch2/3:


--- FlightGear/src/AIModel/AIAircraft.cxx~  2005-10-04 20:23:11.495899550 
+0200
+++ FlightGear/src/AIModel/AIAircraft.cxx   2005-10-04 20:23:11.515898800 
+0200
@@ -36,7 +36,7 @@
 #ifdef _MSC_VER
 #  include float.h
 #  define finite _finite
-#elif defined(sun) || defined(sgi)
+#elif defined(__sun) || defined(sgi)
 #  include ieeefp.h
 #endif
 
--- FlightGear/src/Cockpit/hud.cxx~ 2005-10-04 20:23:28.446154050 +0200
+++ FlightGear/src/Cockpit/hud.cxx  2005-10-04 20:23:28.466190600 +0200
@@ -58,7 +58,7 @@
 #include Main/fg_props.hxx
 #include Scenery/scenery.hxx
 
-#if defined ( __sun__ ) || defined ( __sgi )
+#if defined (__sun) || defined ( __sgi )
 extern C {
 extern void *memmove(void *, const void *, size_t);
 }
--- FlightGear/src/Main/metar_main.cxx~ 2005-10-04 20:23:45.456406450 +0200
+++ FlightGear/src/Main/metar_main.cxx  2005-10-04 20:23:45.466406450 +0200
@@ -31,7 +31,7 @@
 using namespace std;
 
 // text color
-#if defined(__linux__) || defined( __sun__ ) || defined(__CYGWIN__) \
+#if defined(__linux__) || defined(__sun) || defined(__CYGWIN__) \
 || defined( __FreeBSD__ ) || defined ( sgi )
 #  define R \033[31;1m   // red
 #  define G \033[32;1m   // green
--- FlightGear/tests/test-mktime.cxx~   2005-10-04 20:24:02.016664950 +0200
+++ FlightGear/tests/test-mktime.cxx2005-10-04 20:24:02.036670850 +0200
@@ -75,7 +75,7 @@
 #else // ! defined ( MK_TIME_IS_GMT )
 
 // timezone seems to work as a proper offset for Linux  Solaris
-#  if defined( __linux__ ) || defined( __sun__ ) || defined( __CYGWIN__ )
+#  if defined( __linux__ ) || defined(__sun) || defined( __CYGWIN__ )
 #   define TIMEZONE_OFFSET_WORKS 1
 #  endif


Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-03 Thread Martin Spott
Martin Spott wrote:

 --- SimGear/simgear/misc/stdint.hxx~  2005-10-03 18:53:28.606579000 +0200
 +++ SimGear/simgear/misc/stdint.hxx   2005-10-03 18:53:28.632024750 +0200
 @@ -56,7 +56,7 @@
  typedef unsigned short   uint16_t;
  typedef unsigned int uint32_t;
  typedef unsigned __int64 uint64_t;
 -#elif defined(sgi)
 +#elif defined(sgi) || defined( __sun__ )
  # include sys/types.h
  #else
  # include stdint.h

I remembered Andy's pointer to http://predef.sourceforge.net/preos.html
and had a look at the different ways how Solaris-specific defines are
currently implemented within FlightGear and required libraries:


plib/src/util/ul.h:
#elif defined(SOLARIS) || defined(sun)

SimGear/simgear/compiler.h:
#if defined ( sun )

SimGear/simgear/nasal/nasal.h:
  defined(sun386)

SimGear/simgear/timing/sg_time.cxx:
#   if defined( __linux__ ) || defined( __sun__ ) ||defined(__CYGWIN__)

FlightGear/src/AIModel/AIAircraft.cxx:
#elif defined(sun) || defined(sgi)

FlightGear/src/Cockpit/hud.cxx_
#if defined ( __sun__ ) || defined ( __sgi )

FlightGear/src/Main/metar_main.cxx_
#if defined(__linux__) || defined( __sun__ ) || defined(__CYGWIN__) \

FlightGear/tests/test-mktime.cxx_
#  if defined( __linux__ ) || defined( __sun__ ) || defined( __CYGWIN__ )

TerraGear/src/BuildTiles/Parallel/server.cxx:
#if defined (sun) || defined (__CYGWIN__) || defined(sgi)


Would anyone object to a patch that unifies this to (__sun) ?

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-03 Thread Andy Ross
Martin Spott wrote:
 I remembered Andy's pointer to
 http://predef.sourceforge.net/preos.html and had a look at the
 different ways how Solaris-specific defines are currently
 implemented within FlightGear and required libraries:
   [...]
 SimGear/simgear/nasal/nasal.h:
  defined(sun386)
   [...]
 Would anyone object to a patch that unifies this to (__sun)?

Sounds good to me.  Although with the nasal.h one I think I'd prefer
to change that code to one that detects CPU architectures
specifically, without dependence on OS-specific header files.  It's
getting hard to read already, and really isn't much more portable than
a big enumeration of architecture defines.

On a similar note, we're using __CYGWIN__ a *lot* in the current
source code seemingly as a synonym for windows with gcc and not
msvc, which isn't really correct.  The right way to test this would
be to look for _WIN32 and __gcc__ (or !_MSC_VER), which will continue
to work even under, say, mingw32.

There was a bug that came up in IRC a month or two ago that was
related to exactly this issue, IIRC.  A CYGWIN got stuck in as a
synonym for WIN32, and that caused a build failure under MSVC (or
Borland, maybe, I forget the details).

Cygwin is, strictly, a Unix environment and should never need to be
tested except where it is incompatible with our default unix/linux
code.  On windows, we should be trying to build to the WIN32 API and
using _WIN32 as the appropriate test.

Andy

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-03 Thread Erik Hofman

Andy Ross wrote:


On a similar note, we're using __CYGWIN__ a *lot* in the current
source code seemingly as a synonym for windows with gcc and not
msvc, which isn't really correct.  The right way to test this would
be to look for _WIN32 and __gcc__ (or !_MSC_VER), which will continue
to work even under, say, mingw32.


Or better yet:

http://aedion.de/programming/using-cpp-definitions/

Erik

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: Define SUN; Was: [Flightgear-devel] RFC: FlightGear 0.9.9

2005-10-03 Thread Martin Spott
Andy Ross wrote:
 Martin Spott wrote:
 I remembered Andy's pointer to
 http://predef.sourceforge.net/preos.html and had a look at the
 different ways how Solaris-specific defines are currently
 implemented within FlightGear and required libraries:
   [...]
 SimGear/simgear/nasal/nasal.h:
  defined(sun386)
   [...]
 Would anyone object to a patch that unifies this to (__sun)?
 
 Sounds good to me.  Although with the nasal.h one I think I'd prefer
 to change that code to one that detects CPU architectures
 specifically, without dependence on OS-specific header files.

Yes, I know, you're distinguishing big-/little-endianess in this case.
The other ones should be candidates for a cleanup,

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d