galek / maratis

Automatically exported from code.google.com/p/maratis
1 stars 0 forks source link

Missing include in main.cpp #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Experimental branch:

Missing <windows.h> include in file main.cpp

Original issue reported on code.google.com by MaratisB...@gmail.com on 13 Oct 2013 at 9:09

GoogleCodeExporter commented 9 years ago
<windows.h> should not be included there
code need to be cross-platform.

But if the include is needed for compilation on windows,
there might be a problem somewhere else.

Original comment by anael.se...@gmail.com on 13 Oct 2013 at 8:25

GoogleCodeExporter commented 9 years ago
Should we modify MUtils.h this way:

// sleep
#ifdef WIN32
    #include <process.h>
    #include <windows.h>       *** MODIF ***
    #define SLEEP(t) Sleep(t);
#else
    #include <unistd.h>
    #define SLEEP(t) usleep(t*1000);
#endif

Original comment by MaratisB...@gmail.com on 15 Oct 2013 at 5:24

GoogleCodeExporter commented 9 years ago
actually the good include seems to be <WinBase.h> for previous windows 8
and <Synchapi.h> for windows 8

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686298(v=vs.85).aspx

Original comment by anael.se...@gmail.com on 15 Oct 2013 at 8:38

GoogleCodeExporter commented 9 years ago
In fact it seems that WinBase.h & Synchapi.h are children of windows.h
If you look at the examples, they all use windows.h as header, a more generic 
header.

Original comment by MaratisB...@gmail.com on 17 Oct 2013 at 5:43