Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Detecting Windows or Linux...
I'm beginning to make my Windowing library work in Linux as well as Windows via the X library, but I have hit a small snag that I believe I know the answer to, but need confirmation on. I declare my own types in a header file which are defined as a plain Windows or X type based on which OS is detected so that users may write code with my types and then have the code compile on both platforms with no changes beyond "main()" and "WinMain()". My problem is figuring out what is defined in Windows as opposed to Linux to setup my types properly.
Are those the correct definitions to look for, or am I off base here? I've not really worked on a project that compiles on both platforms before and as such have never had the need to figure out what OS I am compiling on. It was always "this program is Windows only" or "this server application is Linux only". Now it's time to bridge the gap and it's been fun thus far! Thanks for the help.