Code: Select all
CompilerIf #PB_Processor_x86
Debug "x86"
CompilerEndIf
Code: Select all
CompilerIf #PB_Processor_x86
Debug "x86"
CompilerEndIf
Code: Select all
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
Debug "x86"
CompilerEndIf
This way no serious all-damaging bug would be ever reported. E.g. the floating point recursion bug we had a while ago.Just think about whether such a bug can occur without there being hundreds of bug reports already.
You are right, of course. And what you are posting is correct and proper PureBasic code.#NULL wrote:You are only checking the value of the constant, which always has a value. You need to compare it to #PB_Compiler_ProcessorCode: Select all
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86 Debug "x86" CompilerEndIf
Code: Select all
CompilerIf PB_Compiler_Processor() = #PB_Processor_x86
Debug "x86"
CompilerEndIf
Code: Select all
CompilerIf SizeOf(Integer) = 4
Debug "x86"
CompilerEndIf