Raised This Month: $ Target: $400
 0% 

Noob question about defines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 12-23-2012 , 17:24   Noob question about defines
Reply With Quote #1

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

Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-23-2012 , 20:36   Re: Noob question about defines
Reply With Quote #2

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

Last edited by fysiks; 12-23-2012 at 20:37.
fysiks is offline
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 12-24-2012 , 05:58   Re: Noob question about defines
Reply With Quote #3

thx. Topic may be closed.
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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