AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Noob question about defines (https://forums.alliedmods.net/showthread.php?t=203826)

Mofforg 12-23-2012 17:24

Noob question about defines
 
Hello all.


Wanna to ask noob question. Am i understand right, that defines can be used to define should we use some features and it will be done on compilation level so it will not load the server in any way like cvars?

For example:

PHP Code:

#define do_1
//#define do_2

public plugin_precache( )
{
#if defined do_1
func1
#endif
#if defined do_2
func2
#endif


Am i understand correctly, that after compilation if we decompile plugin (just as stupid example) we'll see this?!:

PHP Code:

public plugin_precache( )
{
func1



fysiks 12-23-2012 20:36

Re: Noob question about defines
 
You are correct. Preprocessor directives (those that start with '#') will control what is actuallly compiled into the binary file (in this case the .amxx).

Mofforg 12-24-2012 05:58

Re: Noob question about defines
 
thx. Topic may be closed.


All times are GMT -4. The time now is 13:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.