From 7707816349d4bd2a14e9140e85c65f0bfd713718 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Fri, 2 Nov 2007 18:40:41 +0000 Subject: Fixed MacOSX version. Can we use baseunix on linux? We could drop oldlinux then (not available on the mac). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@555 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/USongs.pas | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'Game/Code/Classes/USongs.pas') diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 2eeeec87..7fd58034 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -9,19 +9,17 @@ interface {$I switches.inc} uses - {$ifndef MSWINDOWS} - {$IFDEF DARWIN} - baseunix, - {$ELSE} + {$IFDEF MSWINDOWS} + Windows, + DirWatch, + {$ELSE} + {$IFNDEF DARWIN} oldlinux, + syscall, {$ENDIF} baseunix, UnixType, - syscall, - {$else} - windows, - DirWatch, - {$endif} + {$ENDIF} SysUtils, Classes, ULog, @@ -91,7 +89,7 @@ type fWatch : longint; fParseSongDirectory : boolean; fProcessing : boolean; - {$ifdef win32} + {$ifdef MSWINDOWS} fDirWatch : TDirectoryWatch; {$endif} procedure int_LoadSongList; @@ -169,7 +167,7 @@ begin inherited create( false ); self.freeonterminate := true; - {$IFDEF Win32} + {$IFDEF MSWINDOWS} fDirWatch := TDirectoryWatch.create(nil); fDirWatch.OnChange := DoDirChanged; fDirWatch.Directory := SongPath; @@ -206,7 +204,7 @@ end; procedure TSongs.DoDirChanged(Sender: TObject); begin - LoadSongList(); + LoadSongList(); end; procedure TSongs.Execute(); @@ -284,12 +282,22 @@ var {$ifdef MSWINDOWS} SR: TSearchRecW; // for parsing Songs Directory - {$else} // This should work on all posix systems. + {$ENDIF} + + // eddie: can we merge that? is baseunix working on linux? oldlinux is + // not available on mac os x. + {$IFDEF LINUX} TheDir : oldlinux.pdir; ADirent : oldlinux.pDirent; Entry : Longint; info : oldlinux.stat; - {$endif} + {$ENDIF} + {$IFDEF DARWIN} + TheDir : pdir; + ADirent : pDirent; + Entry : Longint; + info : stat; + {$ENDIF} begin {$ifdef MSWINDOWS} if FindFirstW(Dir + '*', faDirectory, SR) = 0 then // JB_Unicode - windows -- cgit v1.2.3