Compiler macros
Compiler macros
MS compilers have pre-defined macros like the (_WIN64) macro. Never thought about it before, but I was wondering what predefined, if any, macros the PB compiler has?
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: Compiler macros
There are pre-defined constants, e.g. #PB_COMPILER_DATE that do the same job.
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Re: Compiler macros
See here (at the bottom): http://www.purebasic.com/documentation/ ... tives.html
quidquid Latine dictum sit altum videtur
Re: Compiler macros
Offtopic:
@freak
Adding html anchors to the online and offline help would be useful. This way e.g. http://www.purebasic.com/documentation/ ... -constants or selecting the title from the navigation menu would directly jump to the bottom. It can be easily implemented using the id attribute (info here: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3).
@freak
Adding html anchors to the online and offline help would be useful. This way e.g. http://www.purebasic.com/documentation/ ... -constants or selecting the title from the navigation menu would directly jump to the bottom. It can be easily implemented using the id attribute (info here: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3).
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: Compiler macros
Thanks for the replys folks, not exactly what I was talking about but close enough I guess. 
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: Compiler macros
pb devs should add the macro __COUNTER__ which could be usefull.
result
Code: Select all
#include <stdio.h>
int curCounter = 0;
#define RESET_COUNTER curCounter = __COUNTER__ + 1
#define GET_COUNTER __COUNTER__ - curCounter
int main()
{
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
RESET_COUNTER;
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
RESET_COUNTER;
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
printf (" %d\n", GET_COUNTER );
return 0;
}
0
1
2
3
4
5
0
1
2
0
1
2
3
4
5
Re: Compiler macros
@xorc1zt
Well, there is the #PB_Compiler_EnumerationValue constant. Not exactly what you wanted but maybe you didn't know it so far:
Well, there is the #PB_Compiler_EnumerationValue constant. Not exactly what you wanted but maybe you didn't know it so far:
Code: Select all
Enumeration
#GadgetInfo ; Will be 0
#GadgetText ; Will be 1
#GadgetOK ; Will be 2
EndEnumeration
Enumeration #PB_Compiler_EnumerationValue
#GadgetCancel ; Will be 3
#GadgetImage ; Will be 4
#GadgetSound ; Will be 5
EndEnumerationIf any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!


