Thanks Геннадий . On Monday, May 2, 2016 at 10:27:41 AM UTC-4, Геннадий Забула wrote: > > If I use CMake to generate UWP build, it defines WINAPI_FAMILY but don't > defines WINAPI_FAMILY_PARTITION macros. > And following conditions fails in wrong place > # elif defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION(fails > here)) > # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) (should fail > here) > # define THREAD_TIMER_AVAILABLE > # endif > > I suggest to add following to the config.h: > #ifndef NO_OS_DEPENDENCE > > +#if defined(WINAPI_FAMILY) > +#include <winapifamily.h> > +#endif >
Traditionally Wei does not include (or has not included) other headers in config.h. Its the reason we don't add Apple's TargetConditionals.h in the file. Would it be possible to have Cmake force include <winapifamily.h> with /FI ? I used it years ago when I did the initial port to Windows Phone. I used it recently for the nmake based makefile at http://github.com/weidai11/cryptopp/blob/master/cryptest.nmake#L47 . I also use it with other libraries, like OpenSSL (OpenSSL suffers the Windows crippling worse than Crypto++). Or, I can change it to stop testing for "defined(WINAPI_FAMILY_PARTITION)", which should cause a compile failure rather than allow the compile to succeed in a mis-configuration. I.e., # elif defined(WINAPI_FAMILY) # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) # define THREAD_TIMER_AVAILABLE # endif (The one thing I recall is the test for "defined(WINAPI_FAMILY)" has to be on its own line because the preprocessor does not short-circuit like a C statement evaluation). If either sound OK with you, then do you feel like offering a patch? Jeff ********** $ git branch master * windows-store $ grep PARTITION *.h *.cpp config.h:# elif defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION) config.h:# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) config.h:# elif defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION) config.h:# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) config.h:# elif defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION) config.h:# if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) config.h:# elif !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) fipstest.cpp:# if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION) fipstest.cpp:# if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) hrtimer.cpp:# if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_ONE_PARTITION) hrtimer.cpp:# if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY,WINAPI_FAMILY_PHONE_APP) -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
