Thursday, 15 January 2015

c - #defines for host OS and cross-compiler conditional code -



c - #defines for host OS and cross-compiler conditional code -

i have src file has code like:

#ifndef win32 #define ... #endif #ifdef win32 #define ... #endif

to distinguish when compiling under linux or windows. worked great when building natively under both linux (gcc) , windows (mingw), windows build beingness done on vbox vm on linux host

now have pushed on investigate cross-compilation, , have noticed cross compiling on linux host win32 , win64 relevant mingw linux->windows cross-compile tool-chains win32 defined in instance

my question whether there #ifdef can utilize defined case when using either mingw win32 or win64 cross-compiler on linux host, e.g. #define not there if tried build natively on windows host within vm?

the reason need along these lines iron out problems discrepancies how sockets , time.h related stuff handled under linux/gcc, linux cross compiling win32 , win64 using mingw , native windows compilation using mingw (its right nightmare bit different in each case)

c linux windows gcc mingw

No comments:

Post a Comment