Jump to content
  • Advertisement
Sign in to follow this  
droz

Haiku native calling

This topic is 2948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sorry didn't mean to be pushy, thanks for all your hard work writing AngelScript and supporting it.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!