RealBasic: Bedingte Konstanten?

below

below

Aktives Mitglied
Thread Starter
Dabei seit
15.03.2004
Beiträge
13.565
Reaktionspunkte
1.092
Hallo,

in meinem Code habe ich Haufenweise so etwas:
Code:
#If TargetMacOS
	#if DebugBuild
		Declare Function MyFunction Lib "@executable_path/../../../libthelib.dylib" (Something As Integer) As Integer
	#Else
		Declare Function MyFunction Lib "@executable_path/../Frameworks/libthelib.dylib" (Something As Integer) As Integer
	#Endif
#ElseIf TargetWin32
	Declare Function MyFunction Lib "libthelib.dll" (Something As Integer) As Integer
#elseif TargetLinux
	Declare Function MyFunction Lib "libthelib.so" (Something As Integer) As Integer
#Endif

Jetzt würde ich das gerne irgendwie, irgendwo einmal zentral machen, also etwa so:
Code:
#If TargetMacOS
	#if DebugBuild
		dynamicLibraryPath = "@executable_path/../../../libthelib.dylib"
	#Else
		dynamicLibraryPath = "@executable_path/../Frameworks/libthelib.dylib"
	#Endif
#ElseIf TargetWin32
	dynamicLibraryPath =  "libthelib.dll"
#elseif TargetLinux
	dynamicLibraryPath =  "libthelib.so"
#Endif

Dann würde für jede Deklaration nur noch das übrig bleiben:
Code:
Declare Function MyFunction Lib dynamicLibraryPath (Something As Integer) As Integer

Geht das? Wie würde ich das anstellen?

Vielen Dank

Alex
 
Zurück
Oben Unten