]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/stdint.hxx
Update doxgen config and some comments.
[simgear.git] / simgear / misc / stdint.hxx
index 75742d0c305d9fb5b20f9608dae1e158298a471f..94fbd60a50db759b6b3687e053cd03d20faa5440 100644 (file)
@@ -4,20 +4,10 @@
 
 // Copyright (C) 1999  Curtis L. Olson - http://www.flightgear.org/~curt
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
+// Written by Curtis Olson - http://www.flightgear.org/~curt
+// Started September 2001.
 //
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA  02111-1307, USA.
+// This file is in the Public Domain, and comes with no warranty.
 //
 // $Id$
 
@@ -56,7 +46,9 @@ typedef unsigned char    uint8_t;
 typedef unsigned short   uint16_t;
 typedef unsigned int     uint32_t;
 typedef unsigned __int64 uint64_t;
-#elif defined(sgi)
+
+typedef int ssize_t;
+#elif defined(sgi) || defined(__sun)
 # include <sys/types.h>
 #else
 # include <stdint.h>
@@ -92,6 +84,9 @@ inline bool sgIsBigEndian() {
     return (*((char *) &sgEndianTest ) == 0);
 }
 
+inline void sgEndianSwap(int32_t *x) { *x = (int32_t) sg_bswap_32((int32_t) *x); }
+inline void sgEndianSwap(float *x) { *x = (float) sg_bswap_32((float) *x); }
+
 inline void sgEndianSwap(uint16_t *x) { *x = sg_bswap_16(*x); }
 inline void sgEndianSwap(uint32_t *x) { *x = sg_bswap_32(*x); }
 inline void sgEndianSwap(uint64_t *x) { *x = sg_bswap_64(*x); }