Revision: 68945
          http://sourceforge.net/p/brlcad/code/68945
Author:   starseeker
Date:     2016-09-30 18:35:39 +0000 (Fri, 30 Sep 2016)
Log Message:
-----------
Rather than include pstdint.h unconditionally (which is causing problems on 
Windows) make sure of just the PRINTF_INT32_MODIFIER (which is the bit we need).

Modified Paths:
--------------
    brlcad/trunk/src/librt/cache.c

Modified: brlcad/trunk/src/librt/cache.c
===================================================================
--- brlcad/trunk/src/librt/cache.c      2016-09-30 18:22:18 UTC (rev 68944)
+++ brlcad/trunk/src/librt/cache.c      2016-09-30 18:35:39 UTC (rev 68945)
@@ -29,20 +29,51 @@
 #include <errno.h>
 #include <zlib.h>
 
+#include "cache.h"
 #include "bnetwork.h"
-
-#include "cache.h"
-
 #include "bu/cv.h"
 #include "bu/log.h"
 #include "bu/str.h"
 #include "bu/uuid.h"
-#include "pstdint.h"
 #include "rt/db_attr.h"
 #include "rt/db_io.h"
 #include "rt/func.h"
 
+/* Make sure we have PRINTF_INT32_MODIFIER defined */
+#if !defined (_PSTDINT_H_INCLUDED)
+#  if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || 
(defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 
1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || 
defined (__UINT_FAST64_TYPE__)) ))
+#    ifndef PRINTF_INT32_MODIFIER
+#     define PRINTF_INT32_MODIFIER "l"
+#    endif
+#  endif
+#  if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
+#    ifndef PRINTF_INT32_MODIFIER
+#      define PRINTF_INT32_MODIFIER "l"
+#    endif
+#  elif (UINT_MAX == UINT32_MAX)
+#    ifndef PRINTF_INT32_MODIFIER
+#     define PRINTF_INT32_MODIFIER ""
+#    endif
+#  elif (USHRT_MAX == UINT32_MAX)
+#    ifndef PRINTF_INT32_MODIFIER
+#     define PRINTF_INT32_MODIFIER ""
+#    endif
+#  endif
+#  if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
+#    ifndef PRINTF_INT32_MODIFIER
+#     define PRINTF_INT32_MODIFIER "l"
+#    endif
+#  elif (INT_MAX == INT32_MAX)
+#    ifndef PRINTF_INT32_MODIFIER
+#     define PRINTF_INT32_MODIFIER ""
+#    endif
+#  endif
+#  ifndef PRINTF_INT32_MODIFIER
+#    define PRINTF_INT32_MODIFIER ""
+#  endif
+#endif
 
+
 static const char * const cache_mime_type = "brlcad/cache";
 
 

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to