Project forums > Q-Gears

About defines and platform specific.

(1/2) > >>

1) We must use as little defines as posible because it will be hard to support code futher on.
2) We must use as little platform specific functions as posible.

--- Quote ---int
#ifdef MACOSX
(int argc, char *argv[])
--- End quote ---

Why mac use SDL_main instead of main?
All SDL code hidden in the WindowSDL class. If we deside to move to something else macos won't be working at all.
ps: macos CAN work with usual main function.

About itoa. I has no idea that GCC doesn't has this funcions. I'll replace this with something else.
I was thinking about use StdString - std::string convenience wrapper. It has a lot of usefull addition to standart string.

Tell me if something doesnt compile under mac or linux,it's better redone things or two, but has understandable and logical platform independent code.

What is ITOA?

Anyway, I had quite a bit of problems when I was using SDL related to the use of SDL_main. SDL actually redefines your main function.

Mmm, writing your own ITOA wouldn't be that hard.  (I was pretty sure I had used it on GCC/Linux before, but I just looked and it looks liks ATOI is the one I was thinking about.)

On itoa()

It would seem that STL is a c++  template lib  that is non-posix and are not included in g++. STL has been deprecated. This isn't just a linux thing as Microsoft also strongly discurages STL use with thier newest compilier.

I have no problem with main() when it comes to SDL. Maybe a mac thing?

I have GCC 3.2.3, and it has atoi and itoa. It is in stdlib.h.

Why not use STL? There is no need to reinvent the wheel here. And of course Microsoft would say that.


[0] Message Index

[#] Next page

Go to full version