PDA

View Full Version : Compile error when using #section directive


rhelgeby
01-29-2012, 17:51
I'm trying to use the #section directive to name a section of the code with static stock functions (private scoped), so I can access those functions from another file by using the same section name there too. Only those files should have access, not other files.

The compiler doesn't recognize this directive, but according to the Pawn Language Guide it's valid. Is this directive implemented in SourcePawn too, or am I doing something wrong? Just try the code below in the online compiler:

#section a
static stock TestA()
{
}

#section b
static stock TestB()
{
}

Mr. Zero
01-29-2012, 18:03
Wait wait wait. Can it both be static and stock? Aren't those two opposites?

Stock makes the function public and will be removed if not used.
Static makes the function private to that section and will not be removed even if not used.

Personally I have no problem with section usage if I have static and stocks. I never had a static stock function through.

rhelgeby
01-29-2012, 19:26
Stock functions just won't be compiled if they're not used, they are not public.

But this isn't the issue here. It's the compile error with those section directives.

McFlurry
01-29-2012, 19:29
Well, it seems that that directive isn't implemented in SourcePawn. There are other directives that are probably not implemented as well.