From aba1974dad12ef867b92bebb782f0f2e511d8b57 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 22 Apr 1998 13:21:26 +0000 Subject: [PATCH] C++ - ifing the code a bit. --- Aircraft/aircraft.h | 22 ++++++++------ Astro/Makefile.am | 12 ++++---- Astro/Makefile.in | 40 ++++++++++++++++++-------- Astro/{moon.c => moon.cxx} | 16 +++++++---- Astro/{moon.h => moon.hxx} | 27 +++++++++-------- Astro/{orbits.c => orbits.cxx} | 14 ++++++--- Astro/{orbits.h => orbits.hxx} | 22 +++++++------- Astro/{planets.c => planets.cxx} | 15 ++++++---- Astro/{planets.h => planets.hxx} | 24 +++++++--------- Astro/{sky.c => sky.cxx} | 19 ++++++------ Astro/{sky.h => sky.hxx} | 24 +++++++--------- Astro/{stars.c => stars.cxx} | 18 +++++++----- Astro/{stars.h => stars.hxx} | 24 +++++++--------- Astro/{sun.c => sun.cxx} | 17 +++++++---- Astro/{sun.h => sun.hxx} | 26 ++++++++--------- Autopilot/autopilot.h | 12 +++++++- Cockpit/cockpit.h | 13 +++++---- Controls/controls.h | 13 +++++---- FDM/flight.h | 16 ++++++----- Joystick/joystick.h | 17 +++++++++-- Scenery/Makefile.am | 4 +-- Scenery/Makefile.in | 28 +++++++++++++++--- Scenery/obj.c | 9 ++++-- Scenery/obj.h | 17 ++++++----- Scenery/scenery.h | 13 +++++---- Scenery/texload.h | 5 ++-- Scenery/{tilecache.c => tilecache.cxx} | 14 +++++---- Scenery/{tilecache.h => tilecache.hxx} | 16 +++++------ Scenery/{tilemgr.c => tilemgr.cxx} | 9 ++++-- Scenery/{tilemgr.h => tilemgr.hxx} | 24 +++++++--------- 30 files changed, 317 insertions(+), 213 deletions(-) rename Astro/{moon.c => moon.cxx} (97%) rename Astro/{moon.h => moon.hxx} (88%) rename Astro/{orbits.c => orbits.cxx} (96%) rename Astro/{orbits.h => orbits.hxx} (91%) rename Astro/{planets.c => planets.cxx} (96%) rename Astro/{planets.h => planets.hxx} (85%) rename Astro/{sky.c => sky.cxx} (98%) rename Astro/{sky.h => sky.hxx} (83%) rename Astro/{stars.c => stars.cxx} (97%) rename Astro/{stars.h => stars.hxx} (86%) rename Astro/{sun.c => sun.cxx} (96%) rename Astro/{sun.h => sun.hxx} (87%) rename Scenery/{tilecache.c => tilecache.cxx} (96%) rename Scenery/{tilecache.h => tilecache.hxx} (92%) rename Scenery/{tilemgr.c => tilemgr.cxx} (98%) rename Scenery/{tilemgr.h => tilemgr.hxx} (83%) diff --git a/Aircraft/aircraft.h b/Aircraft/aircraft.h index e39985ab2..9f6779804 100644 --- a/Aircraft/aircraft.h +++ b/Aircraft/aircraft.h @@ -28,15 +28,15 @@ #define _AIRCRAFT_H +#include +#include + + #ifdef __cplusplus extern "C" { #endif -#include -#include - - /* Define a structure containing all the parameters for an aircraft */ typedef struct{ fgFLIGHT *flight; @@ -66,9 +66,12 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a); /* $Log$ -/* Revision 1.11 1998/04/21 17:02:27 curt -/* Prepairing for C++ integration. +/* Revision 1.12 1998/04/22 13:26:15 curt +/* C++ - ifing the code a bit. /* + * Revision 1.11 1998/04/21 17:02:27 curt + * Prepairing for C++ integration. + * * Revision 1.10 1998/02/07 15:29:32 curt * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss * @@ -85,9 +88,12 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a); /* $Log$ -/* Revision 1.11 1998/04/21 17:02:27 curt -/* Prepairing for C++ integration. +/* Revision 1.12 1998/04/22 13:26:15 curt +/* C++ - ifing the code a bit. /* + * Revision 1.11 1998/04/21 17:02:27 curt + * Prepairing for C++ integration. + * * Revision 1.10 1998/02/07 15:29:32 curt * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss * diff --git a/Astro/Makefile.am b/Astro/Makefile.am index e9d12c065..4c7a2075e 100644 --- a/Astro/Makefile.am +++ b/Astro/Makefile.am @@ -2,11 +2,11 @@ libdir = ${exec_prefix}/lib lib_LTLIBRARIES = libAstro.la libAstro_la_SOURCES = \ - moon.c moon.h \ - orbits.c orbits.h \ - planets.c planets.h \ - sky.c sky.h \ - stars.c stars.h \ - sun.c sun.h + moon.cxx moon.hxx \ + orbits.cxx orbits.hxx \ + planets.cxx planets.hxx \ + sky.cxx sky.hxx \ + stars.cxx stars.hxx \ + sun.cxx sun.hxx INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator diff --git a/Astro/Makefile.in b/Astro/Makefile.in index 9b9348cb2..562944cbc 100644 --- a/Astro/Makefile.in +++ b/Astro/Makefile.in @@ -74,12 +74,12 @@ libdir = ${exec_prefix}/lib lib_LTLIBRARIES = libAstro.la libAstro_la_SOURCES = \ - moon.c moon.h \ - orbits.c orbits.h \ - planets.c planets.h \ - sky.c sky.h \ - stars.c stars.h \ - sun.c sun.h + moon.cxx moon.hxx \ + orbits.cxx orbits.hxx \ + planets.cxx planets.hxx \ + sky.cxx sky.hxx \ + stars.cxx stars.hxx \ + sun.cxx sun.hxx mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../Include/config.h CONFIG_CLEAN_FILES = @@ -98,10 +98,10 @@ libAstro_la_LDFLAGS = libAstro_la_LIBADD = libAstro_la_OBJECTS = moon.lo orbits.lo planets.lo sky.lo stars.lo \ sun.lo -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) +CXXLINK = $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in @@ -111,13 +111,14 @@ TAR = tar GZIP = --best DEP_FILES = .deps/moon.P .deps/orbits.P .deps/planets.P .deps/sky.P \ .deps/stars.P .deps/sun.P +CXXMKDEP = $(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) SOURCES = $(libAstro_la_SOURCES) OBJECTS = $(libAstro_la_OBJECTS) all: Makefile $(LTLIBRARIES) .SUFFIXES: -.SUFFIXES: .S .c .lo .o .s +.SUFFIXES: .S .c .cxx .lo .o .s $(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu Simulator/Astro/Makefile @@ -184,7 +185,11 @@ distclean-libtool: maintainer-clean-libtool: libAstro.la: $(libAstro_la_OBJECTS) $(libAstro_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libAstro_la_LDFLAGS) $(libAstro_la_OBJECTS) $(libAstro_la_LIBADD) $(LIBS) + $(CXXLINK) -rpath $(libdir) $(libAstro_la_LDFLAGS) $(libAstro_la_OBJECTS) $(libAstro_la_LIBADD) $(LIBS) +.cxx.o: + $(CXXCOMPILE) -c $< +.cxx.lo: + $(LTCXXCOMPILE) -c $< tags: TAGS @@ -251,6 +256,17 @@ maintainer-clean-depend: @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \ < .deps/$(*F).p > .deps/$(*F).P @-rm -f .deps/$(*F).p + +%.o: %.cxx + @echo '$(CXXCOMPILE) -c $<'; \ + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).P -c $< + +%.lo: %.cxx + @echo '$(LTCXXCOMPILE) -c $<'; \ + $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).p -c $< + @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \ + < .deps/$(*F).p > .deps/$(*F).P + @-rm -f .deps/$(*F).p info: dvi: check: all diff --git a/Astro/moon.c b/Astro/moon.cxx similarity index 97% rename from Astro/moon.c rename to Astro/moon.cxx index f5480dd68..53dda6d53 100644 --- a/Astro/moon.c +++ b/Astro/moon.cxx @@ -31,16 +31,17 @@ #include #include -#include -#include - #include #include #include #include -#include
+#include
#include