aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-03 14:00:02 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-03-03 14:00:02 +0000
commitddf0dc62ba1e3bd772e8155d295ddb3487d5d305 (patch)
tree801dd2d41e17fb33e0fe9ddef81214edb407df56 /Game/Code
parent71115fe4d1873e61101f2ceb2c99fc3554ac4171 (diff)
downloadusdx-ddf0dc62ba1e3bd772e8155d295ddb3487d5d305.tar.gz
usdx-ddf0dc62ba1e3bd772e8155d295ddb3487d5d305.tar.xz
usdx-ddf0dc62ba1e3bd772e8155d295ddb3487d5d305.zip
delphi 7 compatibility (inline was introduced with delphi 2005)
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@902 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UAudioDecoder_FFMpeg.pas8
-rw-r--r--Game/Code/Classes/UAudioPlayback_SoftMixer.pas12
-rw-r--r--Game/Code/Classes/ULog.pas2
-rw-r--r--Game/Code/lib/ffmpeg/avformat.pas4
-rw-r--r--Game/Code/lib/ffmpeg/avio.pas4
-rw-r--r--Game/Code/lib/ffmpeg/rational.pas6
-rw-r--r--Game/Code/lib/fft/UFFT.pas14
-rw-r--r--Game/Code/switches.inc11
8 files changed, 40 insertions, 21 deletions
diff --git a/Game/Code/Classes/UAudioDecoder_FFMpeg.pas b/Game/Code/Classes/UAudioDecoder_FFMpeg.pas
index f4c22254..18d6c03b 100644
--- a/Game/Code/Classes/UAudioDecoder_FFMpeg.pas
+++ b/Game/Code/Classes/UAudioDecoder_FFMpeg.pas
@@ -17,7 +17,7 @@ interface
{$MODE Delphi}
{$ENDIF}
-{$I ../switches.inc}
+{$I switches.inc}
//{$DEFINE DebugFFMpegDecode}
@@ -109,9 +109,9 @@ type
audio_buf_size : cardinal;
audio_buf : TAudioBuffer;
- procedure Lock(); inline;
- procedure Unlock(); inline;
- function GetLockMutex(): PSDL_Mutex; inline;
+ procedure Lock(); {$IFDEF HasInline}inline;{$ENDIF}
+ procedure Unlock(); {$IFDEF HasInline}inline;{$ENDIF}
+ function GetLockMutex(): PSDL_Mutex; {$IFDEF HasInline}inline;{$ENDIF}
procedure ParseAudio();
function DecodeFrame(var buffer: TAudioBuffer; bufSize: integer): integer;
diff --git a/Game/Code/Classes/UAudioPlayback_SoftMixer.pas b/Game/Code/Classes/UAudioPlayback_SoftMixer.pas
index 1dc28dcd..e145587c 100644
--- a/Game/Code/Classes/UAudioPlayback_SoftMixer.pas
+++ b/Game/Code/Classes/UAudioPlayback_SoftMixer.pas
@@ -39,8 +39,8 @@ type
class function ConvertAudioFormatToSDL(fmt: TAudioSampleFormat): UInt16;
function InitFormatConversion(): boolean;
- procedure Lock(); inline;
- procedure Unlock(); inline;
+ procedure Lock(); {$IFDEF HasInline}inline;{$ENDIF}
+ procedure Unlock(); {$IFDEF HasInline}inline;{$ENDIF}
public
constructor Create(Engine: TAudioPlayback_SoftMixer);
destructor Destroy(); override;
@@ -75,8 +75,8 @@ type
_volume: integer;
- procedure Lock(); inline;
- procedure Unlock(); inline;
+ procedure Lock(); {$IFDEF HasInline}inline;{$ENDIF}
+ procedure Unlock(); {$IFDEF HasInline}inline;{$ENDIF}
function GetVolume(): integer;
procedure SetVolume(volume: integer);
@@ -100,7 +100,7 @@ type
function InitializeAudioPlaybackEngine(): boolean; virtual; abstract;
function StartAudioPlaybackEngine(): boolean; virtual; abstract;
procedure StopAudioPlaybackEngine(); virtual; abstract;
- procedure AudioCallback(buffer: PChar; size: integer); inline;
+ procedure AudioCallback(buffer: PChar; size: integer); {$IFDEF HasInline}inline;{$ENDIF}
public
function GetName: String; virtual; abstract;
@@ -130,7 +130,7 @@ type
// Interface for Visualizer
function GetPCMData(var data: TPCMData): Cardinal;
- function GetMixer(): TAudioMixerStream; inline;
+ function GetMixer(): TAudioMixerStream; {$IFDEF HasInline}inline;{$ENDIF}
function GetAudioFormatInfo(): TAudioFormatInfo;
// Sounds
diff --git a/Game/Code/Classes/ULog.pas b/Game/Code/Classes/ULog.pas
index 15c590ae..6380b10a 100644
--- a/Game/Code/Classes/ULog.pas
+++ b/Game/Code/Classes/ULog.pas
@@ -52,7 +52,7 @@ type
procedure LogBuffer(const buf : Pointer; const bufLength : Integer; filename : string);
end;
-procedure SafeWriteLn(const msg: string); inline;
+procedure SafeWriteLn(const msg: string); {$IFDEF HasInline}inline;{$ENDIF}
var
Log: TLog;
diff --git a/Game/Code/lib/ffmpeg/avformat.pas b/Game/Code/lib/ffmpeg/avformat.pas
index 7a5678a5..dd99e18b 100644
--- a/Game/Code/lib/ffmpeg/avformat.pas
+++ b/Game/Code/lib/ffmpeg/avformat.pas
@@ -37,6 +37,8 @@ unit avformat;
{$MINENUMSIZE 4} (* use 4-byte enums *)
{$ENDIF}
+{$I switches.inc}
+
interface
uses
@@ -133,7 +135,7 @@ function av_dup_packet (pkt: PAVPacket): integer;
*
* @param pkt packet to free
*)
-procedure av_free_packet (pkt: PAVPacket); inline;
+procedure av_free_packet (pkt: PAVPacket); {$IFDEF HasInline}inline;{$ENDIF}
(*************************************************)
(* fractional numbers for exact pts handling *)
diff --git a/Game/Code/lib/ffmpeg/avio.pas b/Game/Code/lib/ffmpeg/avio.pas
index f3a4f05f..46d847b0 100644
--- a/Game/Code/lib/ffmpeg/avio.pas
+++ b/Game/Code/lib/ffmpeg/avio.pas
@@ -37,6 +37,8 @@ unit avio;
{$MINENUMSIZE 4} (* use 4-byte enums *)
{$ENDIF}
+{$I switches.inc}
+
interface
uses
@@ -366,7 +368,7 @@ function ff_get_v(bc: PByteIOContext): uint64;
cdecl; external av__format;
{$IFEND}
-function url_is_streamed(s: PByteIOContext): integer; inline;
+function url_is_streamed(s: PByteIOContext): integer; {$IFDEF HasInline}inline;{$ENDIF}
(** @note when opened as read/write, the buffers are only used for
writing *)
diff --git a/Game/Code/lib/ffmpeg/rational.pas b/Game/Code/lib/ffmpeg/rational.pas
index 0d6f76b6..14d28162 100644
--- a/Game/Code/lib/ffmpeg/rational.pas
+++ b/Game/Code/lib/ffmpeg/rational.pas
@@ -36,6 +36,8 @@ unit rational;
{$MINENUMSIZE 4} (* use 4-byte enums *)
{$ENDIF}
+{$I switches.inc}
+
interface
uses
@@ -57,14 +59,14 @@ type
* @param b second rational
* @return 0 if a==b, 1 if a>b and -1 if a<b.
*)
-function av_cmp_q(a: TAVRational; b: TAVRational): integer; inline;
+function av_cmp_q(a: TAVRational; b: TAVRational): integer; {$IFDEF HasInline}inline;{$ENDIF}
(**
* Rational to double conversion.
* @param a rational to convert
* @return (double) a
*)
-function av_q2d(a: TAVRational): double; inline;
+function av_q2d(a: TAVRational): double; {$IFDEF HasInline}inline;{$ENDIF}
(**
* Reduce a fraction.
diff --git a/Game/Code/lib/fft/UFFT.pas b/Game/Code/lib/fft/UFFT.pas
index e97812f6..1c4c3e75 100644
--- a/Game/Code/lib/fft/UFFT.pas
+++ b/Game/Code/lib/fft/UFFT.pas
@@ -45,9 +45,11 @@ Fast Fourier Transform routines.
unit UFFT;
-{$ifdef fpc}
- {$mode delphi}{$H+}
-{$endif}
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+{$I switches.inc}
interface
type
@@ -55,7 +57,7 @@ type
PSingleArray = ^TSingleArray;
procedure PowerSpectrum(NumSamples: Integer; In_, Out_: PSingleArray);
-procedure WindowFunc(NumSamples: Integer; in_: PSingleArray); inline;
+procedure WindowFunc(NumSamples: Integer; in_: PSingleArray); {$IFDEF HasInline}inline;{$ENDIF}
implementation
@@ -124,7 +126,7 @@ begin
end;
end;
-function FastReverseBits(i, NumBits: Integer): Integer; inline;
+function FastReverseBits(i, NumBits: Integer): Integer; {$IFDEF HasInline}inline;{$ENDIF}
begin
if (NumBits <= MaxFastBits) then
result := gFFTBitTable[NumBits - 1][i]
@@ -334,7 +336,7 @@ begin
FreeMem(ImagOut);
end;
-procedure WindowFunc(NumSamples: Integer; in_: PSingleArray); inline;
+procedure WindowFunc(NumSamples: Integer; in_: PSingleArray); {$IFDEF HasInline}inline;{$ENDIF}
var
i: Integer;
begin
diff --git a/Game/Code/switches.inc b/Game/Code/switches.inc
index 46997405..9b31f3af 100644
--- a/Game/Code/switches.inc
+++ b/Game/Code/switches.inc
@@ -23,9 +23,20 @@
{$ENDIF}
{$DEFINE DLL_CDECL}
+ {$DEFINE HasInline}
{$UNDEF UseSerialPort}
{$ELSE}
{$DEFINE Delphi}
+
+ // Delphi version numbers (ignore versions released before Delphi 6 as they miss the $IF directive):
+ // Delphi 6 (VER140), Delphi 7 (VER150), Delphi 8 (VER160)
+ // Delphi 9/2005 (VER170), Delphi 10/2006 (VER180)
+
+ // the inline-procedure directive was introduced with Delphi 2005
+ {$IF not (Defined(VER140) or Defined(VER150) or Defined(VER160))}
+ {$DEFINE HasInline}
+ {$IFEND}
+
{$DEFINE DLL_STDCALL}
{$UNDEF UseSerialPort}
{$ENDIF}