SOLVED! PB 6.04 CompilerIf #PB_Backend_Asm don't work

Just starting out? Need help? Post your questions and find answers here.
SMaag
Enthusiast
Enthusiast
Posts: 329
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

SOLVED! PB 6.04 CompilerIf #PB_Backend_Asm don't work

Post 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)
Last edited by SMaag on Tue Jan 09, 2024 9:26 pm, edited 1 time in total.
SMaag
Enthusiast
Enthusiast
Posts: 329
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Re: PB 6.04 CompilerIf #PB_Backend_Asm don't work

Post by SMaag »

Sorry! It is my fault!

Can't use : CompilerIf #PB_Backend_Asm

correct: CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm
User avatar
ChrisR
Addict
Addict
Posts: 1484
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: PB 6.04 CompilerIf #PB_Backend_Asm don't work

Post 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
Post Reply