Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

c++ preproccessor

Name: Anonymous 2007-11-17 22:07

I want to include windows.h if my program is being compiled in windows, but unistd.h if in linux...

something like this:

#if _WIN32
    #include <windows.h>        // for Sleep()
#if else
    #include <unistd.h>            // for sleep()
#endif

How would I do this?

Name: Anonymous 2007-11-18 7:53

#ifdef WIN32
#include <windows.h>
#define mssleep(d) Sleep(d)
#else
#define mssleep(d) usleep(1000*d)
#include <unistd.h> 
#endif

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List