|
@@ -30,6 +30,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
#include <stddef.h> /* ptrdiff_t */
|
|
|
#include <stdlib.h> /* exit */
|
|
|
|
|
|
+#if defined(HASH_DEFINE_OWN_STDINT) && HASH_DEFINE_OWN_STDINT
|
|
|
+/* This codepath is provided for backward compatibility, but I plan to remove it. */
|
|
|
+#warning "HASH_DEFINE_OWN_STDINT is deprecated; please use HASH_NO_STDINT instead"
|
|
|
+typedef unsigned int uint32_t;
|
|
|
+typedef unsigned char uint8_t;
|
|
|
+#elif defined(HASH_NO_STDINT) && HASH_NO_STDINT
|
|
|
+#else
|
|
|
+#include <stdint.h> /* uint8_t, uint32_t */
|
|
|
+#endif
|
|
|
+
|
|
|
/* These macros use decltype or the earlier __typeof GNU extension.
|
|
|
As decltype is only available in newer compilers (VS2010 or gcc 4.3+
|
|
|
when compiling c++ source) this code uses whatever method is needed
|
|
@@ -62,23 +72,6 @@ do {
|
|
|
} while (0)
|
|
|
#endif
|
|
|
|
|
|
-/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */
|
|
|
-#if defined(_WIN32)
|
|
|
-#if defined(_MSC_VER) && _MSC_VER >= 1600
|
|
|
-#include <stdint.h>
|
|
|
-#elif defined(__WATCOMC__) || defined(__MINGW32__) || defined(__CYGWIN__)
|
|
|
-#include <stdint.h>
|
|
|
-#else
|
|
|
-typedef unsigned int uint32_t;
|
|
|
-typedef unsigned char uint8_t;
|
|
|
-#endif
|
|
|
-#elif defined(__GNUC__) && !defined(__VXWORKS__)
|
|
|
-#include <stdint.h>
|
|
|
-#else
|
|
|
-typedef unsigned int uint32_t;
|
|
|
-typedef unsigned char uint8_t;
|
|
|
-#endif
|
|
|
-
|
|
|
#ifndef uthash_malloc
|
|
|
#define uthash_malloc(sz) malloc(sz) /* malloc fcn */
|
|
|
#endif
|