AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   #pragma reqclass, reqlib, loadlib (https://forums.alliedmods.net/showthread.php?t=196292)

Jje 09-18-2012 06:01

#pragma reqclass, reqlib, loadlib
 
Hello! Who knows what mean this pragmas?

jimaway 09-18-2012 07:10

Re: #pragma reqclass, reqlib, loadlib
 
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

Jje 09-18-2012 08:33

Re: #pragma reqclass, reqlib, loadlib
 
Quote:

Originally Posted by jimaway (Post 1801756)
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?


All times are GMT -4. The time now is 08:14.

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