pragma library
#1

Hi,

can someone give me idea of using #pragma library, I mean how to use it? Don't say it's useless, I must try it myself first.
Thanks.
Reply
#2

Never had to use it before, but it says it's often misused in SA-MP
Reply
#3

I know, but if it's mentioned in wiki, it should be able to be used. Example please.
Reply
#4

Found an old include that uses it.
pawn Код:
/*  
 *           PointToPoint Functions
 *  © Copyright 2010, Blacklite & <__Ethan__>
 *
 */


#if defined _PointToPoint_included
    #endinput
#endif
#define _PointToPoint_included
#pragma library PointToPoint

native Float:PointToPoint2D(Float:x1,Float:y1,Float:x2,Float:y2);
native Float:PointToPoint3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2);
Where "PointToPoint" was the .dll file in the plugins directory. Did you read the wiki? It's pretty straight forward
Reply
#5

Only usage i think of it is this:
pawn Код:
#pragma unused intvar
/*
This appears after the symbol you wish to surpress the "symbol is never used" warning for. Generally the preferred method of doing this is by using stock however this is not always applicable (e.g. function parameters cannot not be compiled).
*/
Reply
#6

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Found an old include that uses it.
pawn Код:
/*  
 *           PointToPoint Functions
 *  © Copyright 2010, Blacklite & <__Ethan__>
 *
 */


#if defined _PointToPoint_included
    #endinput
#endif
#define _PointToPoint_included
#pragma library PointToPoint

native Float:PointToPoint2D(Float:x1,Float:y1,Float:x2,Float:y2);
native Float:PointToPoint3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2);
Where "PointToPoint" was the .dll file in the plugins directory. Did you read the wiki? It's pretty straight forward
Oh, so it works exactly the same as plugin? I thought it's something different. What is the difference in writing "#pragma library PointToPoint" and not in this example? The result will be the same.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)