Attempt to resolve ambiguity between #include <config.h> for simgear vs.

flightgear, especially when this occurs in a simgear .hxx file.  This is
now expressly forbidden, and will cause problems anyways because we now
changed the name to <simgear_config.h> which isn't installed, so you can't
include it in an installed header file.
This commit is contained in:
curt
2001-05-15 19:26:22 +00:00
parent 2d21e59b54
commit e2b4c0787a
46 changed files with 134 additions and 247 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ AC_FUNC_VPRINTF
AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \ AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
random setitimer getitimer signal GetLocalTime rint getrusage ) random setitimer getitimer signal GetLocalTime rint getrusage )
AM_CONFIG_HEADER(simgear/config.h) AM_CONFIG_HEADER(simgear/simgear_config.h)
AC_OUTPUT( \ AC_OUTPUT( \
Makefile \ Makefile \
-5
View File
@@ -24,11 +24,6 @@
**************************************************************************/ **************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <math.h> #include <math.h>
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
-4
View File
@@ -30,10 +30,6 @@
#define _SG_CONSTANTS_H #define _SG_CONSTANTS_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#ifdef SG_HAVE_STD_INCLUDES #ifdef SG_HAVE_STD_INCLUDES
-4
View File
@@ -26,10 +26,6 @@
#ifndef _LOGSTREAM_H #ifndef _LOGSTREAM_H
#define _LOGSTREAM_H #define _LOGSTREAM_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
// At least Irix needs this // At least Irix needs this
-4
View File
@@ -31,10 +31,6 @@
#define _EPHEMERIS_HXX #define _EPHEMERIS_HXX
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <plib/sg.h> #include <plib/sg.h>
#include <simgear/ephemeris/star.hxx> #include <simgear/ephemeris/star.hxx>
-4
View File
@@ -1,7 +1,3 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_IOSTREAM #include STL_IOSTREAM
-4
View File
@@ -22,10 +22,6 @@
// //
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -28,10 +28,6 @@
#define _SG_BINOBJ_HXX #define _SG_BINOBJ_HXX
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <plib/sg.h> #include <plib/sg.h>
#include <simgear/compiler.h> #include <simgear/compiler.h>
-4
View File
@@ -21,10 +21,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <math.h> #include <math.h>
#include <simgear/magvar/magvar.hxx> #include <simgear/magvar/magvar.hxx>
-4
View File
@@ -33,10 +33,6 @@
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/** /**
* Magnetic variation wrapper class. * Magnetic variation wrapper class.
* *
-4
View File
@@ -22,10 +22,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> // for random(), srandom() #include <stdlib.h> // for random(), srandom()
#include <time.h> // for time() to seed srandom() #include <time.h> // for time() to seed srandom()
-4
View File
@@ -33,10 +33,6 @@
# error This library requires C++ # error This library requires C++
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <plib/sg.h> #include <plib/sg.h>
-4
View File
@@ -37,10 +37,6 @@
/* */ /* */
/********************************************************************/ /********************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STDINT_H #ifdef HAVE_STDINT_H
# include <stdint.h> # include <stdint.h>
#endif #endif
-4
View File
@@ -6,10 +6,6 @@
// //
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -12,10 +12,6 @@
#ifndef __PROPS_HXX #ifndef __PROPS_HXX
#define __PROPS_HXX #define __PROPS_HXX
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -1,8 +1,4 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdlib.h> // atof() atoi() #include <stdlib.h> // atof() atoi()
-4
View File
@@ -3,10 +3,6 @@
// Test harness. // Test harness.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_IOSTREAM #include STL_IOSTREAM
-4
View File
@@ -30,10 +30,6 @@
#define _SG_PATH_HXX #define _SG_PATH_HXX
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_STRING #include STL_STRING
-4
View File
@@ -32,10 +32,6 @@
# error This library requires C++ # error This library requires C++
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#if defined( SG_HAVE_STD_INCLUDES ) #if defined( SG_HAVE_STD_INCLUDES )
-4
View File
@@ -21,10 +21,6 @@
// //
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "strutils.hxx" #include "strutils.hxx"
const string whitespace = " \n\r\t"; const string whitespace = " \n\r\t";
-4
View File
@@ -28,10 +28,6 @@
#ifndef _zfstream_hxx #ifndef _zfstream_hxx
#define _zfstream_hxx #define _zfstream_hxx
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#ifdef HAVE_ZLIB #ifdef HAVE_ZLIB
-4
View File
@@ -33,10 +33,6 @@
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_STRING #include STL_STRING
-4
View File
@@ -33,10 +33,6 @@
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_STRING #include STL_STRING
+1 -1
View File
@@ -1,5 +1,5 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <simgear_config.h>
#endif #endif
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
+1 -1
View File
@@ -21,7 +21,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <simgear_config.h>
#endif #endif
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
-4
View File
@@ -22,10 +22,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#ifdef SG_HAVE_STD_INCLUDE #ifdef SG_HAVE_STD_INCLUDE
-4
View File
@@ -33,10 +33,6 @@
# error This library requires C++ # error This library requires C++
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ ) #if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
# include <windows.h> # include <windows.h>
#endif #endif
-4
View File
@@ -16,10 +16,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -25,10 +25,6 @@
#ifndef _SG_CLOUD_HXX_ #ifndef _SG_CLOUD_HXX_
#define _SG_CLOUD_HXX_ #define _SG_CLOUD_HXX_
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <plib/ssg.h> #include <plib/ssg.h>
+1 -1
View File
@@ -24,7 +24,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <simgear_config.h>
#endif #endif
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
-4
View File
@@ -25,10 +25,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -25,10 +25,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -23,10 +23,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <plib/sg.h> #include <plib/sg.h>
#include <plib/ssg.h> #include <plib/ssg.h>
-4
View File
@@ -23,10 +23,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_IOSTREAM #include STL_IOSTREAM
-4
View File
@@ -25,10 +25,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <stdio.h> #include <stdio.h>
-4
View File
@@ -1,7 +1,3 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <sys/time.h> #include <sys/time.h>
+1
View File
@@ -13,6 +13,7 @@ libsgtiming_a_SOURCES = \
geocoord.cxx \ geocoord.cxx \
lowleveltime.cxx \ lowleveltime.cxx \
sg_time.cxx \ sg_time.cxx \
timestamp.cxx \
timezone.cxx timezone.cxx
INCLUDES += -I$(top_srcdir) INCLUDES += -I$(top_srcdir)
-4
View File
@@ -22,10 +22,6 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <errno.h> // for errno #include <errno.h> // for errno
-4
View File
@@ -34,10 +34,6 @@
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#ifdef SG_HAVE_STD_INCLUDES #ifdef SG_HAVE_STD_INCLUDES
+124
View File
@@ -0,0 +1,124 @@
/**
* \file timestamp.cxx
* Provides a class for managing a timestamp (seconds & milliseconds.)
*/
// Written by Curtis Olson, started December 1998.
//
// Copyright (C) 1998 Curtis L. Olson - curt@flightgear.org
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program 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
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <simgear/compiler.h>
#ifdef SG_HAVE_STD_INCLUDES
# include <ctime>
#else
# include <time.h>
#endif
#ifdef HAVE_SYS_TIMEB_H
# include <sys/timeb.h> // for ftime() and struct timeb
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h> // for gettimeofday()
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h> // for get/setitimer, gettimeofday, struct timeval
#endif
// -dw- want to use metrowerks time.h
#ifdef macintosh
# include <time.h>
# include <timer.h>
#endif
#ifdef WIN32
# include <windows.h>
# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ )
# define NEAR /* */
# define FAR /* */
# endif
# include <mmsystem.h>
#endif
#include "timestamp.hxx"
void SGTimeStamp::stamp() {
#if defined( WIN32 )
unsigned int t;
t = timeGetTime();
seconds = 0;
usec = t * 1000;
#elif defined( HAVE_GETTIMEOFDAY )
struct timeval current;
struct timezone tz;
// sg_timestamp currtime;
gettimeofday(&current, &tz);
seconds = current.tv_sec;
usec = current.tv_usec;
#elif defined( HAVE_GETLOCALTIME )
SYSTEMTIME current;
GetLocalTime(&current);
seconds = current.wSecond;
usec = current.wMilliseconds * 1000;
#elif defined( HAVE_FTIME )
struct timeb current;
ftime(&current);
seconds = current.time;
usec = current.millitm * 1000;
// -dw- uses time manager
#elif defined( macintosh )
UnsignedWide ms;
Microseconds(&ms);
seconds = ms.lo / 1000000;
usec = ms.lo - ( seconds * 1000000 );
#else
# error Port me
#endif
}
// increment the time stamp by the number of microseconds (usec)
SGTimeStamp operator + (const SGTimeStamp& t, const long& m) {
#ifdef WIN32
return SGTimeStamp( 0, t.usec + m );
#else
return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000,
( t.usec + m ) % 1000000 );
#endif
}
// difference between time stamps in microseconds (usec)
long operator - (const SGTimeStamp& a, const SGTimeStamp& b)
{
#if defined( WIN32 )
return a.usec - b.usec;
#else
return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec);
#endif
}
-93
View File
@@ -33,46 +33,8 @@
#endif #endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#ifdef SG_HAVE_STD_INCLUDES
# include <ctime>
#else
# include <time.h>
#endif
#ifdef HAVE_SYS_TIMEB_H
# include <sys/timeb.h> // for ftime() and struct timeb
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h> // for gettimeofday()
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h> // for get/setitimer, gettimeofday, struct timeval
#endif
// -dw- want to use metrowerks time.h
#ifdef macintosh
# include <time.h>
# include <timer.h>
#endif
#ifdef WIN32
# include <windows.h>
# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ )
# define NEAR /* */
# define FAR /* */
# endif
# include <mmsystem.h>
#endif
// MSVC++ 6.0 kuldge - Need forward declaration of friends. // MSVC++ 6.0 kuldge - Need forward declaration of friends.
class SGTimeStamp; class SGTimeStamp;
@@ -158,61 +120,6 @@ inline SGTimeStamp& SGTimeStamp::operator = (const SGTimeStamp& t)
return *this; return *this;
} }
inline void SGTimeStamp::stamp() {
#if defined( WIN32 )
unsigned int t;
t = timeGetTime();
seconds = 0;
usec = t * 1000;
#elif defined( HAVE_GETTIMEOFDAY )
struct timeval current;
struct timezone tz;
// sg_timestamp currtime;
gettimeofday(&current, &tz);
seconds = current.tv_sec;
usec = current.tv_usec;
#elif defined( HAVE_GETLOCALTIME )
SYSTEMTIME current;
GetLocalTime(&current);
seconds = current.wSecond;
usec = current.wMilliseconds * 1000;
#elif defined( HAVE_FTIME )
struct timeb current;
ftime(&current);
seconds = current.time;
usec = current.millitm * 1000;
// -dw- uses time manager
#elif defined( macintosh )
UnsignedWide ms;
Microseconds(&ms);
seconds = ms.lo / 1000000;
usec = ms.lo - ( seconds * 1000000 );
#else
# error Port me
#endif
}
// increment the time stamp by the number of microseconds (usec)
inline SGTimeStamp operator + (const SGTimeStamp& t, const long& m) {
#ifdef WIN32
return SGTimeStamp( 0, t.usec + m );
#else
return SGTimeStamp( t.seconds + ( t.usec + m ) / 1000000,
( t.usec + m ) % 1000000 );
#endif
}
// difference between time stamps in microseconds (usec)
inline long operator - (const SGTimeStamp& a, const SGTimeStamp& b)
{
#if defined( WIN32 )
return a.usec - b.usec;
#else
return 1000000 * (a.seconds - b.seconds) + (a.usec - b.usec);
#endif
}
#endif // _TIMESTAMP_HXX #endif // _TIMESTAMP_HXX
+1 -1
View File
@@ -1,5 +1,5 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <simgear_config.h>
#endif #endif
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
+4
View File
@@ -2,6 +2,10 @@
#define _XGL_H #define _XGL_H
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
# include <windows.h> # include <windows.h>
#endif #endif
-4
View File
@@ -1,8 +1,4 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
-4
View File
@@ -1,9 +1,5 @@
// easyxml.cxx - implementation of EasyXML interfaces. // easyxml.cxx - implementation of EasyXML interfaces.
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <string.h> // strcmp() #include <string.h> // strcmp()
-4
View File
@@ -8,10 +8,6 @@
#ifndef __EASYXML_HXX #ifndef __EASYXML_HXX
#define __EASYXML_HXX #define __EASYXML_HXX
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_IOSTREAM #include STL_IOSTREAM