Compiler related Procedure Extensions

Everything else that doesn't fall into one of the other PB categories.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Compiler related Procedure Extensions

Post by va!n »

Afaik, there are some compiler related procedure extensions, like "_MMX" "_Unicode" ... Is there any way to use an includefile like following small example and using the specific procedure named Test() instead using Test(), Test_MMX() and so on? Or does this only work for compiled libs? o_O

Code: Select all

Procedure Test()
  ProcedureReturn 1
EndProcedure

Procedure Test_Unicode()
  ProcedureReturn 2
EndProcedure

Procedure Test_MMX()
  ProcedureReturn 3
EndProcedure

Debug Test()
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

You can already do this for the _Unicode procedure by using CompilerIf and #PB_Compiler_Unicode.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

yes, i know about the CompilerIf thing... thanks... but as PB support procedure extensions too, isnt there any other way as i shown in my small code example? does the code example only works for compiled libs? Afaik you can split commands by using YourProcedure() and YourProcedure_Unicode() for example... same for some other stuff like MMX and so on....
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

You could do the same as PB does. Create a jump table with prototypes
that you initialize at the start of your program according to the current
CPU features.

Code: Select all

Prototype Test()
global Test.Test

if IsMMX()
  Test = @Test_MMX()
else
  Test = @Test()
Endif
But I don't think there is another easy way.
Athlon64 3700+, 1024MB Ram, Radeon X1600
Post Reply