Raised This Month: $ Target: $400
 0% 

#pragma reqclass, reqlib, loadlib


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jje
Junior Member
Join Date: Oct 2011
Old 09-18-2012 , 06:01   #pragma reqclass, reqlib, loadlib
Reply With Quote #1

Hello! Who knows what mean this pragmas?

Last edited by Jje; 09-18-2012 at 06:12.
Jje is offline
Send a message via ICQ to Jje Send a message via Skype™ to Jje
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-18-2012 , 07:10   Re: #pragma reqclass, reqlib, loadlib
Reply With Quote #2

Quote:
The next important preprocessor macro is pragma. This directive is used mainly for things that the AMXX core (or any other core running a Pawn plugin) must know before the plugin is loaded.

The pragma directive can be used for many things in AMXX - for instance, increasing the amount of memory (16kb by default) allocated to each plugin. If you want 128kb, for example, you can run this macro somewhere in your plugin:

Code:
#pragma dynamic 32768

This is not particularly useful for most plugins, but is generally needed for plugins that use a lot of memory, such as WC3, Superhero Mod, or any mod of that calibre.

pragma is also used for many other operations, such as semicolon (forces the compiler to use semicolons to close lines, use #pragma semicolon 1), libraries/classes (#pragma library "library", #pragma reqlib "mylib", #pragma reqclass "myclass", etc. - for a demonstration of these, look at the top of the module header files).
https://forums.alliedmods.net/showthread.php?t=46798

next time use the search before posting
jimaway is offline
Jje
Junior Member
Join Date: Oct 2011
Old 09-18-2012 , 08:33   Re: #pragma reqclass, reqlib, loadlib
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
https://forums.alliedmods.net/showthread.php?t=46798

next time use the search before posting
Thx. I searched here, in google, in pawn tutorial, but couldn't find.
I read the topic and includes, but I still don't understand what do they mean
For example:
Code:
#if AMXX_VERSION_NUM >= 175
 #pragma reqlib cstrike
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma loadlib cstrike
 #endif
#else
 #pragma library cstrike
#endif
As I understand, #pragma library used to declare that prototypes in this file belongs to module specified in pragma, but I can't understand how it works, and why in 175+ versions of AmxModX it's using other pragmas, what is AMXMODX_NOAUTOLOAD?

Last edited by Jje; 09-18-2012 at 08:45.
Jje is offline
Send a message via ICQ to Jje Send a message via Skype™ to Jje
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 08:14.


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