It looks like you're new here. If you want to get involved, click one of these buttons!
Hello all,
New to the Orx Engine. I've compiled it using Visual Studio, I notice that by default Orx uses FASTCALL when exporting to DLL. Is there a way to change to that CDECL? Without having to change every FASTCALL name to CDECL?
Comments
Hi @LeftyGuitar and welcome here!
You can simply define orxFASTCALL at compile time (in your IDE or on the command line) to whatever calling convention you want to use.
Alternatively, you can also modify its definition directly in
include/base/orxDecl.h
.Out of curiosity, why do you want to use cdecl, instead of say, stdcall?
Hello iarwain and thanks.
I understand why you might be curious. The reason I want to use CDECL is for compatbility reasons maily. I want to write a wrapper of Orx for the Euphoria programming language. Euphoria allows you to call functions from DLLs, but it doesn't currently support FASTCALL under 32-bits (and probably won't, but again its for compatbility reasons). I'd also like to make wrappers for other programming languages if all goes well. Also, Euphoria can only call functions from DLLs with programs/libraries that were programmed in C, not really C++.
Ah thanks for the details, that makes sense.
I haven't heard of Euphoria in quite a long time!
As a small recommendation, if STDCALL is supported, I'd recommend using it over CDECL when possible. That was what was used in the past for orx/FreeBasic, for example.
That being said, you should have everything you need for any FFI-related purposes available in
orxDecl.h
.Don't hesitate if you have more questions. I'd also recommend joining our Discord server as others are/have been working on wrapping orx for languages such as Nim or OCaml and might have valuable insights to share.
No problem. I didn't know there was a FreeBasic wrapper. I saw there was an NIM and OCaml wrapper being made. I have modified the orxDecl.h file and was able to compile using the CDECL calling convention. I think STDCALL is supported, though I already compiled it using CDECL.
Euphoria has evolved over the years. https://openeuphoria.org/index.wc
It has a small but friendly community. The new version is called OpenEuphoria after it went open source and is on Version 4 as of now.
Thanks for the help and I'll be around if I have more questions. Of course once I get the wrapper to usable status, I'll be showing it.
I removed the FreeBasic work a few years ago as it was unmaintained and mostly obsolete and no one showed any interest for it.
Thanks for the details regarding Euphoria, I'll have a closer look this weekend.
Looking forward to see your wrapper!
Ah I see. No problem. It will be awhile before I have anything showable, but I'll post it when I do.
Thanks for your help again.