Revision: 57192
          http://sourceforge.net/p/brlcad/code/57192
Author:   starseeker
Date:     2013-08-28 02:25:32 +0000 (Wed, 28 Aug 2013)
Log Message:
-----------
Neither gmtime_s nor _gmtime_s works as a function test - try the symbol check.

Modified Paths:
--------------
    brlcad/trunk/CMakeLists.txt

Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2013-08-28 02:18:10 UTC (rev 57191)
+++ brlcad/trunk/CMakeLists.txt 2013-08-28 02:25:32 UTC (rev 57192)
@@ -1704,7 +1704,17 @@
 BRLCAD_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
 BRLCAD_FUNCTION_EXISTS(getprogname HAVE_GETPROGNAME)
 BRLCAD_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-BRLCAD_FUNCTION_EXISTS(_gmtime_s HAVE__GMTIME_S)
+
+# we do this manually for now because CHECK_SYMBOL_EXISTS and
+# CHECK_PROTOTYPE_EXISTS are both terribly broken.
+# test for _gmtime_s()
+if("${HAVE__GMTIME_S}" MATCHES "^${HAVE__GMTIME_S}$")
+  check_c_source_compiles("#include <time.h>\n int main() {struct tm* tm; 
time_t testtime; (void)_gmtime_s(&testtime, &tm); return 0; }" HAVE__GMTIME_S)
+  if(HAVE__GMTIME_S)
+    CONFIG_H_APPEND(BRLCAD "#cmakedefine HAVE__GMTIME_S 1\n")
+  endif(HAVE__GMTIME_S)
+endif("${HAVE__GMTIME_S}" MATCHES "^${HAVE__GMTIME_S}$")
+
 BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL)
 BRLCAD_FUNCTION_EXISTS(lrand48 HAVE_LRAND48)
 BRLCAD_FUNCTION_EXISTS(memset HAVE_MEMSET)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to