aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-10 06:24:16 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-10 06:24:16 +0000
commit8dc13b99b51555be6fa16d271ddb02d995b46d96 (patch)
tree83fb595c0ed16c5ffebcfa865eb3112322e66cdd /src/base
parentd6554ccc1ec223c52f33ff034491e64ac1fa92aa (diff)
downloadusdx-8dc13b99b51555be6fa16d271ddb02d995b46d96.tar.gz
usdx-8dc13b99b51555be6fa16d271ddb02d995b46d96.tar.xz
usdx-8dc13b99b51555be6fa16d271ddb02d995b46d96.zip
FreeBSD compatibility fixes:
- {$IF Defined(Linux)} -> {$IF Defined(Linux) or Defined(BSD)} or {$IF Defined(UNIX)} - config-freebsd.inc added git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1357 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base')
-rw-r--r--src/base/UAudioCore_Portaudio.pas6
-rw-r--r--src/base/UCommon.pas17
-rw-r--r--src/base/UConfig.pas2
-rw-r--r--src/base/UDLLManager.pas31
-rw-r--r--src/base/UMain.pas8
-rw-r--r--src/base/UPlatform.pas24
-rw-r--r--src/base/uPluginLoader.pas12
7 files changed, 48 insertions, 52 deletions
diff --git a/src/base/UAudioCore_Portaudio.pas b/src/base/UAudioCore_Portaudio.pas
index bcc8a001..cd279d99 100644
--- a/src/base/UAudioCore_Portaudio.pas
+++ b/src/base/UAudioCore_Portaudio.pas
@@ -50,11 +50,11 @@ const
// Note1: Portmixer has no mixer support for paASIO and paWASAPI at the moment
// Note2: Windows Default-API is MME, but DirectSound is faster
array[0..0] of TPaHostApiTypeId = ( paDirectSound );
-{$ELSEIF Defined(LINUX)}
- // Note: Portmixer has no mixer support for JACK at the moment
- array[0..2] of TPaHostApiTypeId = ( paALSA, paJACK, paOSS );
{$ELSEIF Defined(DARWIN)}
array[0..0] of TPaHostApiTypeId = ( paDefaultApi ); // paCoreAudio
+{$ELSEIF Defined(UNIX)}
+ // Note: Portmixer has no mixer support for JACK at the moment
+ array[0..2] of TPaHostApiTypeId = ( paALSA, paJACK, paOSS );
{$ELSE}
array[0..0] of TPaHostApiTypeId = ( paDefaultApi );
{$IFEND}
diff --git a/src/base/UCommon.pas b/src/base/UCommon.pas
index 41e3c1f1..54c54760 100644
--- a/src/base/UCommon.pas
+++ b/src/base/UCommon.pas
@@ -81,7 +81,7 @@ uses
// data used by the ...Locale() functions
-{$IFDEF LINUX}
+{$IF Defined(LINUX) or Defined(BSD)}
var
PrevNumLocale: string;
@@ -91,7 +91,7 @@ const
function setlocale(category: integer; locale: pchar): pchar; cdecl; external 'c' name 'setlocale';
-{$ENDIF}
+{$IFEND}
// In Linux and maybe MacOSX some units (like cwstring) call setlocale(LC_ALL, '')
// to set the language/country specific locale (e.g. charset) for this application.
@@ -111,17 +111,17 @@ function setlocale(category: integer; locale: pchar): pchar; cdecl; external 'c'
// for each call to projectM instead of changing it globally.
procedure SetDefaultNumericLocale();
begin
- {$ifdef LINUX}
+ {$IF Defined(LINUX) or Defined(BSD)}
PrevNumLocale := setlocale(LC_NUMERIC, nil);
setlocale(LC_NUMERIC, 'C');
- {$endif}
+ {$IFEND}
end;
procedure RestoreNumericLocale();
begin
- {$ifdef LINUX}
+ {$IF Defined(LINUX) or Defined(BSD)}
setlocale(LC_NUMERIC, PChar(PrevNumLocale));
- {$endif}
+ {$IFEND}
end;
(*
@@ -275,7 +275,7 @@ var
FilePath, LocalFileName: string;
SearchInfo: TSearchRec;
begin
-{$IFDEF LINUX} // eddie: Changed FPC to LINUX: Windows and Mac OS X dont have case sensitive file systems
+{$IF Defined(LINUX) or Defined(BSD)}
// speed up standard case
if FileExists(FileName) then
begin
@@ -300,8 +300,9 @@ begin
end;
FindClose(SearchInfo);
{$ELSE}
+ // Windows and Mac OS X do not have case sensitive file systems
Result := FileExists(FileName);
-{$ENDIF}
+{$IFEND}
end;
diff --git a/src/base/UConfig.pas b/src/base/UConfig.pas
index b77c2a5a..9ee0a668 100644
--- a/src/base/UConfig.pas
+++ b/src/base/UConfig.pas
@@ -85,6 +85,8 @@ const
{$I ../config-win.inc}
{$ELSEIF Defined(Linux)}
{$I ../config-linux.inc}
+ {$ELSEIF Defined(FreeBSD)}
+ {$I ../config-freebsd.inc}
{$ELSEIF Defined(Darwin)}
{$I ../config-darwin.inc}
{$ELSE}
diff --git a/src/base/UDLLManager.pas b/src/base/UDLLManager.pas
index 3d32a72a..e71a7eb0 100644
--- a/src/base/UDLLManager.pas
+++ b/src/base/UDLLManager.pas
@@ -45,25 +45,24 @@ var
const
DLLPath = 'Plugins';
- {$IFDEF MSWINDOWS}
- DLLExt = '.dll';
- {$ENDIF}
- {$IFDEF LINUX}
- DLLExt = '.so';
- {$ENDIF}
- {$IFDEF DARWIN}
- DLLExt = '.dylib';
- {$ENDIF}
+{$IF Defined(MSWINDOWS)}
+ DLLExt = '.dll';
+{$ELSEIF Defined(DARWIN)}
+ DLLExt = '.dylib';
+{$ELSEIF Defined(UNIX)}
+ DLLExt = '.so';
+{$IFEND}
implementation
-uses {$IFDEF MSWINDOWS}
- windows,
- {$ELSE}
- dynlibs,
- {$ENDIF}
- ULog,
- SysUtils;
+uses
+ {$IFDEF MSWINDOWS}
+ windows,
+ {$ELSE}
+ dynlibs,
+ {$ENDIF}
+ ULog,
+ SysUtils;
constructor TDLLMan.Create;
diff --git a/src/base/UMain.pas b/src/base/UMain.pas
index 08b9cc4a..c9167aa7 100644
--- a/src/base/UMain.pas
+++ b/src/base/UMain.pas
@@ -451,12 +451,12 @@ begin
// This would create a new OpenGL render-context and all texture data
// would be invalidated.
// On Linux the mode MUST be resetted, otherwise graphics will be corrupted.
- {$IFDEF LINUX}
+ {$IF Defined(LINUX) or Defined(BSD)}
if boolean( Ini.FullScreen ) then
SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN)
else
SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_RESIZABLE);
- {$ENDIF}
+ {$IFEND}
end;
SDL_KEYDOWN:
begin
@@ -473,7 +473,7 @@ begin
// FIXME: SDL_SetVideoMode creates a new OpenGL RC so we have to
// reload all texture data (-> whitescreen bug).
// Only Linux is able to handle screen-switching this way.
- {$IFDEF LINUX}
+ {$IF Defined(LINUX) or Defined(BSD)}
if boolean( Ini.FullScreen ) then
begin
SDL_SetVideoMode(ScreenW, ScreenH, (Ini.Depth+1) * 16, SDL_OPENGL or SDL_FULLSCREEN);
@@ -486,7 +486,7 @@ begin
end;
glViewPort(0, 0, ScreenW, ScreenH);
- {$ENDIF}
+ {$IFEND}
end
// if print is pressed -> make screenshot and save to screenshot path
else if (Event.key.keysym.sym = SDLK_SYSREQ) or (Event.key.keysym.sym = SDLK_PRINT) then
diff --git a/src/base/UPlatform.pas b/src/base/UPlatform.pas
index 1dcdb5b9..e88e45b2 100644
--- a/src/base/UPlatform.pas
+++ b/src/base/UPlatform.pas
@@ -43,15 +43,13 @@ implementation
uses
SysUtils,
- {$IFDEF MSWINDOWS}
+ {$IF Defined(MSWINDOWS)}
UPlatformWindows,
- {$ENDIF}
- {$IFDEF LINUX}
- UPlatformLinux,
- {$ENDIF}
- {$IFDEF DARWIN}
+ {$ELSEIF Defined(DARWIN)}
UPlatformMacOSX,
- {$ENDIF}
+ {$ELSEIF Defined(UNIX)}
+ UPlatformLinux,
+ {$IFEND}
ULog;
@@ -158,15 +156,13 @@ end;
initialization
-{$IFDEF MSWINDOWS}
+{$IF Defined(MSWINDOWS)}
Platform_singleton := TPlatformWindows.Create;
-{$ENDIF}
-{$IFDEF LINUX}
- Platform_singleton := TPlatformLinux.Create;
-{$ENDIF}
-{$IFDEF DARWIN}
+{$ELSEIF Defined(DARWIN)}
Platform_singleton := TPlatformMacOSX.Create;
-{$ENDIF}
+{$ELSEIF Defined(UNIX)}
+ Platform_singleton := TPlatformLinux.Create;
+{$IFEND}
finalization
Platform_singleton.Free;
diff --git a/src/base/uPluginLoader.pas b/src/base/uPluginLoader.pas
index b2142702..d0e878c4 100644
--- a/src/base/uPluginLoader.pas
+++ b/src/base/uPluginLoader.pas
@@ -93,15 +93,13 @@ type
end;
const
- {$IFDEF MSWINDOWS}
+{$IF Defined(MSWINDOWS)}
PluginFileExtension = '.dll';
- {$ENDIF}
- {$IFDEF LINUX}
- PluginFileExtension = '.so';
- {$ENDIF}
- {$IFDEF DARWIN}
+{$ELSEIF Defined(DARWIN)}
PluginFileExtension = '.dylib';
- {$ENDIF}
+{$ELSEIF Defined(UNIX)}
+ PluginFileExtension = '.so';
+{$IFEND}
implementation