Defined INT64_C() and UINT64_C() unless defined by <inttypes.h>
Jarkko Hietaniemi [Wed, 15 Nov 2000 02:17:06 +0000 (02:17 +0000)]
(a macro to define signed and unsigned integer constants).

p4raw-id: //depot/perl@7690

handy.h

diff --git a/handy.h b/handy.h
index 22f6173..ba3a812 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -133,6 +133,16 @@ typedef U64TYPE U64;
 #   endif
 #endif /* PERL_CORE */
 
+#ifndef UINT64_C /* usually from <inttypes.h> */
+#   ifdef HAS_LONG_LONG 
+#       define INT64_C(c)      CAT2(c,LL)
+#       define UINT64_C(c)     CAT2(c,ULL)
+#   else
+#       define INT64_C(c)      ((I64TYPE)(c))
+#       define UINT64_C(c)     ((U64TYPE)(c))
+#   endif
+#endif
+
 /* Mention I8SIZE, U8SIZE, I16SIZE, U16SIZE, I32SIZE, U32SIZE,
    I64SIZE, and U64SIZE here so that metaconfig pulls them in. */