From 201990b5d9d28abb67314076f577190f7a39f3ae Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 25 Jul 2005 07:16:10 +0000 Subject: [PATCH] (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build --- Makefile | 1 - music/bemidi.h | 2 +- music/dmusic.c | 12 ++++++------ music/dmusic.h | 2 +- music/extmidi.c | 13 ++++++------- music/extmidi.h | 2 +- music/null_m.c | 6 +++--- music/null_m.h | 2 +- music/os2_m.c | 6 +++--- music/os2_m.h | 2 +- music/win32_m.c | 7 ++++--- music/win32_m.h | 2 +- sdl.c | 5 +++++ sound/null_s.c | 6 +++--- sound/null_s.h | 2 +- sound/sdl_s.c | 17 +++++++++++------ sound/sdl_s.h | 2 +- sound/win32_s.c | 13 +++++++------ sound/win32_s.h | 2 +- table/engines.h | 2 +- table/namegen.h | 4 ++-- video/dedicated_v.c | 22 +++++++++++----------- video/dedicated_v.h | 2 +- video/null_v.c | 12 ++++++------ video/null_v.h | 2 +- video/sdl_v.c | 27 ++++++++++++++++----------- video/sdl_v.h | 2 +- video/win32_v.c | 18 +++++++++--------- video/win32_v.h | 2 +- win32.c | 7 ++----- 30 files changed, 108 insertions(+), 96 deletions(-) diff --git a/Makefile b/Makefile index cea5a31a56..c04fc4bd35 100644 --- a/Makefile +++ b/Makefile @@ -337,7 +337,6 @@ ifdef PROFILE endif CDEFS=-DWITH_REV -CFLAGS += -I. -I- ifndef DEBUG ifndef PROFILE diff --git a/music/bemidi.h b/music/bemidi.h index 5cca9e46d9..10ead59ff9 100644 --- a/music/bemidi.h +++ b/music/bemidi.h @@ -3,7 +3,7 @@ #ifndef MUSIC_BEMIDI_H #define MUSIC_BEMIDI_H -#include "hal.h" +#include "../hal.h" extern const HalMusicDriver _bemidi_music_driver; diff --git a/music/dmusic.c b/music/dmusic.c index 0880fdc7a7..357b667b30 100644 --- a/music/dmusic.c +++ b/music/dmusic.c @@ -26,15 +26,15 @@ /* DirectMusic driver for Win32 */ /* Based on dxmci from TTDPatch */ -#include "stdafx.h" +#include "../stdafx.h" #ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT -#include "openttd.h" -#include "string.h" -#include "variables.h" -#include "sound.h" -#include "music/dmusic.h" +#include "../openttd.h" +#include "../string.h" +#include "../variables.h" +#include "../sound.h" +#include "dmusic.h" static const char * DMusicMidiStart(const char * const *parm); static void DMusicMidiStop(void); diff --git a/music/dmusic.h b/music/dmusic.h index f4eec306d9..5d0990137b 100644 --- a/music/dmusic.h +++ b/music/dmusic.h @@ -3,7 +3,7 @@ #ifndef MUSIC_DMUSIC_H #define MUSIC_DMUSIC_H -#include "hal.h" +#include "../hal.h" extern const HalMusicDriver _dmusic_midi_driver; diff --git a/music/extmidi.c b/music/extmidi.c index d976b6fa62..1e04e356b7 100644 --- a/music/extmidi.c +++ b/music/extmidi.c @@ -2,13 +2,12 @@ #ifndef __BEOS__ #ifndef __MORPHOS__ -#include "stdafx.h" - -#include "openttd.h" -#include "music/extmidi.h" -#include "sound.h" -#include "string.h" -#include "variables.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "../sound.h" +#include "../string.h" +#include "../variables.h" +#include "extmidi.h" #include #include #include diff --git a/music/extmidi.h b/music/extmidi.h index a4feba16f2..681c34bd67 100644 --- a/music/extmidi.h +++ b/music/extmidi.h @@ -3,7 +3,7 @@ #ifndef MUSIC_EXTERNAL_H #define MUSIC_EXTERNAL_H -#include "hal.h" +#include "../hal.h" extern const HalMusicDriver _extmidi_music_driver; diff --git a/music/null_m.c b/music/null_m.c index a1fec1f725..c76a602115 100644 --- a/music/null_m.c +++ b/music/null_m.c @@ -1,8 +1,8 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "music/null_m.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "null_m.h" static const char* NullMidiStart(const char* const* parm) { return NULL; } static void NullMidiStop(void) {} diff --git a/music/null_m.h b/music/null_m.h index 62f6036a9b..0f3e2cfa5f 100644 --- a/music/null_m.h +++ b/music/null_m.h @@ -3,7 +3,7 @@ #ifndef MUSIC_NULL_H #define MUSIC_NULL_H -#include "hal.h" +#include "../hal.h" extern const HalMusicDriver _null_music_driver; diff --git a/music/os2_m.c b/music/os2_m.c index 1d4d3fb83e..ef25592607 100644 --- a/music/os2_m.c +++ b/music/os2_m.c @@ -1,8 +1,8 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "music/os2_m.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "os2_m.h" #define INCL_DOS #define INCL_OS2MM diff --git a/music/os2_m.h b/music/os2_m.h index 3e5a83c0b7..173f096a5b 100644 --- a/music/os2_m.h +++ b/music/os2_m.h @@ -3,7 +3,7 @@ #ifndef MUSIC_OS2_H #define MUSIC_OS2_H -#include "hal.h" +#include "../hal.h" extern const HalMusicDriver _os2_music_driver; diff --git a/music/win32_m.c b/music/win32_m.c index 8edfc55c71..3ec1d5ec23 100644 --- a/music/win32_m.c +++ b/music/win32_m.c @@ -1,9 +1,10 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "music/win32_m.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "win32_m.h" #include +#include static struct { bool stop_song; diff --git a/music/win32_m.h b/music/win32_m.h index 56a558f2c3..83893ed1e4 100644 --- a/music/win32_m.h +++ b/music/win32_m.h @@ -3,7 +3,7 @@ #ifndef MUSIC_WIN32_H #define MUSIC_WIN32_H -#include "hal.h" +#include "../hal.h" extern const HalMusicDriver _win32_music_driver; diff --git a/sdl.c b/sdl.c index 3aaacbea46..cc0145aab6 100644 --- a/sdl.c +++ b/sdl.c @@ -1,6 +1,9 @@ /* $Id$ */ #include "stdafx.h" + +#ifdef WITH_SDL + #include "openttd.h" #include "sdl.h" #include @@ -127,3 +130,5 @@ void SdlClose(uint32 x) #endif } } + +#endif diff --git a/sound/null_s.c b/sound/null_s.c index 00f8c40396..f68c4b13a1 100644 --- a/sound/null_s.c +++ b/sound/null_s.c @@ -1,8 +1,8 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "sound/null_s.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "null_s.h" static const char *NullSoundStart(const char * const *parm) { return NULL; } static void NullSoundStop(void) {} diff --git a/sound/null_s.h b/sound/null_s.h index 5f9a90a92b..6ccd19aed9 100644 --- a/sound/null_s.h +++ b/sound/null_s.h @@ -3,7 +3,7 @@ #ifndef SOUND_NULL_H #define SOUND_NULL_H -#include "hal.h" +#include "../hal.h" extern const HalSoundDriver _null_sound_driver; diff --git a/sound/sdl_s.c b/sound/sdl_s.c index c9cb2b3956..762be59b66 100644 --- a/sound/sdl_s.c +++ b/sound/sdl_s.c @@ -1,11 +1,14 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "driver.h" -#include "mixer.h" -#include "sdl.h" -#include "sound/sdl_s.h" +#include "../stdafx.h" + +#ifdef WITH_SDL + +#include "../openttd.h" +#include "../driver.h" +#include "../mixer.h" +#include "../sdl.h" +#include "sdl_s.h" #include static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len) @@ -40,3 +43,5 @@ const HalSoundDriver _sdl_sound_driver = { SdlSoundStart, SdlSoundStop, }; + +#endif diff --git a/sound/sdl_s.h b/sound/sdl_s.h index 5808f68dee..6fc2b6dc0e 100644 --- a/sound/sdl_s.h +++ b/sound/sdl_s.h @@ -3,7 +3,7 @@ #ifndef SOUND_SDL_H #define SOUND_SDL_H -#include "hal.h" +#include "../hal.h" extern const HalSoundDriver _sdl_sound_driver; diff --git a/sound/win32_s.c b/sound/win32_s.c index 736c00d9c8..b32c2e7465 100644 --- a/sound/win32_s.c +++ b/sound/win32_s.c @@ -1,12 +1,13 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "driver.h" -#include "functions.h" -#include "mixer.h" -#include "sound/win32_s.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "../driver.h" +#include "../functions.h" +#include "../mixer.h" +#include "win32_s.h" #include +#include static HWAVEOUT _waveout; static WAVEHDR _wave_hdr[2]; diff --git a/sound/win32_s.h b/sound/win32_s.h index ff1cb11589..65c6a957da 100644 --- a/sound/win32_s.h +++ b/sound/win32_s.h @@ -3,7 +3,7 @@ #ifndef SOUND_WIN32_H #define SOUND_WIN32_H -#include "hal.h" +#include "../hal.h" extern const HalSoundDriver _win32_sound_driver; diff --git a/table/engines.h b/table/engines.h index 83bec4b574..a1eeada084 100644 --- a/table/engines.h +++ b/table/engines.h @@ -7,7 +7,7 @@ * This file contains all the data for vehicles */ -#include "sound.h" +#include "../sound.h" /** Writes the properties of a vehicle into the EngineInfo struct. * @see EngineInfo diff --git a/table/namegen.h b/table/namegen.h index 0a4113f509..f24440cd97 100644 --- a/table/namegen.h +++ b/table/namegen.h @@ -1,7 +1,7 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" +#include "../stdafx.h" +#include "../openttd.h" static const char *name_original_english_1[] = { "Great ", diff --git a/video/dedicated_v.c b/video/dedicated_v.c index 6440d6fe93..5396ad3480 100644 --- a/video/dedicated_v.c +++ b/video/dedicated_v.c @@ -1,19 +1,19 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "debug.h" -#include "functions.h" -#include "network.h" -#include "video/dedicated_v.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "dedicated_v.h" #ifdef ENABLE_NETWORK -#include "gfx.h" -#include "window.h" -#include "command.h" -#include "console.h" -#include "variables.h" +#include "../debug.h" +#include "../functions.h" +#include "../gfx.h" +#include "../network.h" +#include "../window.h" +#include "../command.h" +#include "../console.h" +#include "../variables.h" #ifdef __OS2__ # include /* gettimeofday */ diff --git a/video/dedicated_v.h b/video/dedicated_v.h index 61a76a95d4..9ba1223d3a 100644 --- a/video/dedicated_v.h +++ b/video/dedicated_v.h @@ -3,7 +3,7 @@ #ifndef VIDEO_DEDICATED_H #define VIDEO_DEDICATED_H -#include "hal.h" +#include "../hal.h" extern const HalVideoDriver _dedicated_video_driver; diff --git a/video/null_v.c b/video/null_v.c index 8f7cee988f..0e3e330b19 100644 --- a/video/null_v.c +++ b/video/null_v.c @@ -1,11 +1,11 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "gfx.h" -#include "variables.h" -#include "video/null_v.h" -#include "window.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "../gfx.h" +#include "../variables.h" +#include "../window.h" +#include "null_v.h" static void* _null_video_mem = NULL; diff --git a/video/null_v.h b/video/null_v.h index cb84c4cfd9..56922d9b30 100644 --- a/video/null_v.h +++ b/video/null_v.h @@ -3,7 +3,7 @@ #ifndef VIDEO_NULL_H #define VIDEO_NULL_H -#include "hal.h" +#include "../hal.h" extern const HalVideoDriver _null_video_driver; diff --git a/video/sdl_v.c b/video/sdl_v.c index 462b5d3094..0ff082f172 100644 --- a/video/sdl_v.c +++ b/video/sdl_v.c @@ -1,17 +1,20 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "debug.h" -#include "functions.h" -#include "gfx.h" -#include "macros.h" -#include "sdl.h" -#include "window.h" -#include "video/sdl_v.h" +#include "../stdafx.h" + +#ifdef WITH_SDL + +#include "../openttd.h" +#include "../debug.h" +#include "../functions.h" +#include "../gfx.h" +#include "../macros.h" +#include "../sdl.h" +#include "../window.h" +#include "../network.h" +#include "../variables.h" +#include "sdl_v.h" #include -#include "network.h" -#include "variables.h" static SDL_Surface *_sdl_screen; static bool _all_modes; @@ -488,3 +491,5 @@ const HalVideoDriver _sdl_video_driver = { SdlVideoChangeRes, SdlVideoFullScreen, }; + +#endif diff --git a/video/sdl_v.h b/video/sdl_v.h index 78fa48f4ac..07ba50f3c5 100644 --- a/video/sdl_v.h +++ b/video/sdl_v.h @@ -3,7 +3,7 @@ #ifndef VIDEO_SDL_H #define VIDEO_SDL_H -#include "hal.h" +#include "../hal.h" extern const HalVideoDriver _sdl_video_driver; diff --git a/video/win32_v.c b/video/win32_v.c index fdd74dc98b..6710459ef8 100644 --- a/video/win32_v.c +++ b/video/win32_v.c @@ -1,14 +1,14 @@ /* $Id$ */ -#include "stdafx.h" -#include "openttd.h" -#include "functions.h" -#include "gfx.h" -#include "macros.h" -#include "network.h" -#include "variables.h" -#include "window.h" -#include "video/win32_v.h" +#include "../stdafx.h" +#include "../openttd.h" +#include "../functions.h" +#include "../gfx.h" +#include "../macros.h" +#include "../network.h" +#include "../variables.h" +#include "../window.h" +#include "win32_v.h" #include static struct { diff --git a/video/win32_v.h b/video/win32_v.h index eba72cc8ff..ccc9aed942 100644 --- a/video/win32_v.h +++ b/video/win32_v.h @@ -3,7 +3,7 @@ #ifndef VIDEO_WIN32_H #define VIDEO_WIN32_H -#include "hal.h" +#include "../hal.h" bool MyShowCursor(bool show); diff --git a/win32.c b/win32.c index e60e2f5299..95139e480a 100644 --- a/win32.c +++ b/win32.c @@ -25,17 +25,14 @@ #include "music/win32_m.h" #include "sound/null_s.h" +#include "sound/sdl_s.h" #include "sound/win32_s.h" #include "video/dedicated_v.h" #include "video/null_v.h" +#include "video/sdl_v.h" #include "video/win32_v.h" -#ifdef WITH_SDL - #include "sound/sdl_s.h" - #include "video/sdl_v.h" -#endif - static bool _has_console; #if defined(__MINGW32__) || defined(__CYGWIN__)