Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Os compile directive inside your code

Author
Message
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 22nd May 2019 10:58 Edited at: 22nd May 2019 11:06
Hi.
Is there some commands to ignore a portion of code (linux or windows destination).

for example



in fact i've include my own extern dll call, but not use them for linux.

Thanks !
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 22nd May 2019 12:30
You can use GetDeviceBaseName() to find out what system you are currently running on

if GetDeviceName() = "linux"
// LINUX CODE
elseif GetDeviceName() = "windows"
// windows code
endif

#etc...
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 22nd May 2019 16:58
i know that...but the compiler ignore the code between if the function not exists ?
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 22nd May 2019 17:05 Edited at: 22nd May 2019 17:08
What? Im not sure that sentence makes sense?

The function can be called from any platform and will tell you which platform your currently running on. So you can run code on certain platforms and not on others. So on windows you can call code in your dll but on linux not call the code.

Im not sure what your problem is?

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 22nd May 2019 22:42 Edited at: 23rd May 2019 05:29
They are talking about a pre-processor command similar to #ifdef commands in C languages.
Commands like that do not exist in AGK
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 23rd May 2019 04:37
@blinkOk : yes.

Many thanks.

Login to post a reply

Server time is: 2024-11-22 21:53:43
Your offset time is: 2024-11-22 21:53:43