Haiku native calling

Started by
4 comments, last by droz 13 years, 7 months ago
I got native calling conventions to work on Haiku OS which is a open-source clone of BeOS. To compile AngelScript you have to use GCC4 which is not the default (GCC 2.95 is for compatibility with BeOS). To switch to GCC4 run the following:

setgcc x86 gcc4


You will also need to add -march=i686 to the makefiles or you will get a linker error for __sync_sub_and_fetch_4

#elif __HAIKU__    #define AS_HAIKU    // Only x86-32 is currently supported by Haiku, but they do plan to support    // x86-64 and PowerPC in the future, so should go ahead and check the platform    // for future compatibility    #if defined(i386) && !defined(__LP64__)        #define AS_X86        #define THISCALL_RETURN_SIMPLE_IN_MEMORY        #define CDECL_RETURN_SIMPLE_IN_MEMORY        #define STDCALL_RETURN_SIMPLE_IN_MEMORY    #else        #define AS_MAX_PORTABILITY    #endif            #define AS_POSIX_THREADS    #if !( ( (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) || __GNUC__ > 4) )        // Only with GCC 4.1 was the atomic instructions available        #define AS_NO_ATOMIC    #endif


All tests pass.
Advertisement
Are you not interested in supporting this platform? I know it's not a typical target for writing games, but I'm writing a general scripting language using angelscript so I want to support as many platforms as possible. If you aren't interested it's no problem I can just maintain the support in my copy of angelscript that I build into my project.

Haiku does have a port of SDL, a OpenGL stack, and other gaming related libraries.
Patience, my friend. :)

I was about to add this configuration to the SVN now.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Sorry didn't mean to be pushy, thanks for all your hard work writing AngelScript and supporting it.
Added in revision 671. Thanks! :)

What OS is this? What makes it different from the other open source OS?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

BeOS was a closed-source operating system in the mid to late 90s that was originally written specifically for a computer called the BeBox. The BeBox didn't do so well and instead they started selling the operating system. It picked up some following because of it's very good threading support (at least at the time). Be (the company behind BeOS) eventually went out of business. Haiku is a open-source re-creation of the operating system and is actually binary compatible with the last official BeOS release.

You can read more about it on Wikipedia if you would like. It doesn't have a huge following, but the Haiku project has been going strong for I think nine years now, so it does have dedicated developers. It's actually picking up a lot of features and many open-source games also run on it.

Interestingly enough Apple offered Be Inc. 125 Million to buy it, but they wanted 200 million to sell. Apple went on to buy NeXT and turn that into Mac OS X.

In May FLOSS Weekly had a podcast on Haiku and thats what got me interested in it, so I decided to port my project. If anyone is interested you can listen to it here: http://twit.tv/floss120.

This topic is closed to new replies.

Advertisement