2

I'm thinking about using PhysicsFS in my game engine project, but I'd like to first make sure it's entirely platform-independent. That's because I'd like to port my engine to some rather obscure platforms after I'm done with the Windows code (Wii Homebrew, for example).

Paul Manta
  • 30,618
  • 31
  • 128
  • 208

1 Answers1

2

In accordance with the official specs the developers provide on their site it:

Compiles/runs on GNU/Linux (x86, PPC, MIPS, Sparc, Alpha, Itanium, and x86-64 tested; gcc). Compiles/runs on Windows, Win95 and later (x86 tested; Visual C++, Visual Studio, Cygwin, and MinGW). Compiles/runs on Mac OS X (x86 and PPC tested; XCode).

And even

May compile and run elsewhere with little to no modification. Success stories and patches are welcome.

So the answer is Yes, it is platform-independent.

Update from April, 20 2011

Following @rubenvb advice, I'd better define it as a cross-platform library. That's because PhysicsFS library utilizes #ifdefs and provides particular implementations for Windows, BeOS / Haiku, Mac OS X, OS/2, PocketPC, POSIX and UNIX platforms.

ezpresso
  • 7,896
  • 13
  • 62
  • 94
  • 1
    Running on any particular finite set of platforms is not an indication of being platform-independent. There's a huge volume of code from the 80s and 90s that's full of horribly non-portable constructs with `#ifdef`s for 20+ different operating systems. Platform-independent on the other hand means it conforms to the broadest standards (e.g. plain C, or even unhosted C implementations). – R.. GitHub STOP HELPING ICE Apr 16 '11 at 20:08
  • This level of perfection is not reachable in reality. You might be a perfectionist if you do believe in what you have said first:) – ezpresso Apr 19 '11 at 08:46
  • It's not only reachable, it's easy if your code (1) does not depend on system facilities not specified in your target standard, and (2) you actually know the standard you're targeting. The latter seems to be the problem in practice most of the time... – R.. GitHub STOP HELPING ICE Apr 19 '11 at 11:21
  • (3) The compiler and target system follow the standard (say ANSI C) you're targeting. Here's the crux of the matter! – ezpresso Apr 19 '11 at 14:09
  • As long as you tell Windows users they need to use gcc instead of MSVC, you're 99% past that obstacle. – R.. GitHub STOP HELPING ICE Apr 19 '11 at 14:24
  • There are no gcc/sdcc implementations for PIC, SmartXA, and many other microcontrollers. Some of gcc implementations have bugs. And things are even more worse when it comes to C++. – ezpresso Apr 20 '11 at 08:17
  • I would definitely say cross-platform, but platform-independent is stretching it. You can't say that without looking at the code, like @R. says. – rubenvb Apr 20 '11 at 16:33
  • I never said you should target gcc. What I said is that platform-independent means sticking purely to what's specified as part of the C language. To support pseudo-C compilers like MSVC that don't actually support the C language, your code would also have to be *language-independent*, which is a much bigger challenge. :-) – R.. GitHub STOP HELPING ICE Apr 20 '11 at 17:49