Page 1 of 1

SOLVED! PB 6.04 CompilerIf #PB_Backend_Asm don't work

Posted: Tue Jan 09, 2024 9:03 pm
by SMaag
on PB6.04 LTS it is not possible to compile with
CompilerIf #PB_Backend_Asm because it is always #False and #PB_Backend_C is always #TRUE

Code: Select all

; PureBasic 6.04 LTS (Windows - x64)
; does not matter which Compiler you adjust. It is always C-Backend!

Debug "#PB_Backend_Asm = " + #PB_Backend_Asm
Debug "#PB_Backend_C = " + #PB_Backend_C

CompilerIf #PB_Backend_Asm
  
  MessageRequester("Backend!", "ASM-Backend")
  
CompilerElse
  
  MessageRequester("Backend!", "C-Backend")
  
CompilerEndIf


CompilerIf #PB_Backend_C
  
  MessageRequester("Backend!", "C-Backend")
  
CompilerElse
  
  MessageRequester("Backend!", "ASM-Backend")
  
CompilerEndIf

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)

Re: PB 6.04 CompilerIf #PB_Backend_Asm don't work

Posted: Tue Jan 09, 2024 9:25 pm
by SMaag
Sorry! It is my fault!

Can't use : CompilerIf #PB_Backend_Asm

correct: CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm

Re: PB 6.04 CompilerIf #PB_Backend_Asm don't work

Posted: Tue Jan 09, 2024 9:29 pm
by ChrisR
Yes, the constant that changes value depending on the compiler used is #PB_Compiler_Backend
The other 2 constants have fixed values #PB_Backend_Asm = 0 and #PB_Backend_C = 1. just to test #PB_Compiler_Backend value

CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm
CompilerIf #PB_Compiler_Backend = #PB_Backend_C