It is currently Fri Aug 23, 2019 11:10 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: OS Function
PostPosted: Tue Nov 04, 2003 7:28 pm 
Offline
User
User

Joined: Sun Nov 02, 2003 1:47 pm
Posts: 77
Location: Washington
Is there a function that can report if you are using the linux or the windows compiler? So somethings that you are forced to use API for or other things, can be optional like:

#If GetOS() = Linux
LoadLibrary(0, "MyLINUXFunction.so")
#Else
LoadLibrary(0, "MyWindowsFunction.DLL")
#EndIf

Failing that, does anyone know how to detect if you are in linux, or windows? I dont want to keep two separate source copies just to compile on two separate OS's

_________________
AMD 2600+, nVidia Geforce FX 5200 128 MB DDR, 512 DDR, RedHat 9


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 04, 2003 7:40 pm 
Offline
Administrator
Administrator

Joined: Wed Apr 23, 2003 7:57 pm
Posts: 1321
Location: Belgium
It's all in the help file under Compiler Directives

Code:
Works exactly like a regular Select : EndSelect but will tell the compiler which code should be compiled. It's useful when building multi-OSes programs to customize some programs part by using OS specific functions.

Example :

CompilerSelect #OS
  CompilerCase #AmigaOS
    ; some Amiga specific code
  CompilerCase #Linux    ; some Linux specific code
CompilerEndSelect

 

Reserved Constants

The PureBasic compiler has several reserved constants which can be useful to the programmer:

  #PB_Compiler_Date: Contains the current date, at the compile time, in the PureBasic date format (see Date).
  #PB_Compiler_OS : This constant allows to determine on which OS the compiler is currently running. It can be one of the following value:
    - #PB_OS_Windows: The compiler is running on Windows
    - #PB_OS_Linux:   The compiler is running on Linux
    - #PB_OS_AmigaOS: The compiler is running on AmigaOS
     

_________________
Berikco

http://www.vispluk.be


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 04, 2003 8:23 pm 
Offline
User
User

Joined: Sun Nov 02, 2003 1:47 pm
Posts: 77
Location: Washington
Thanks

_________________
AMD 2600+, nVidia Geforce FX 5200 128 MB DDR, 512 DDR, RedHat 9


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye