Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Add support for uintmax_t type on FreeBSD 4.9

From: David Syzdek <hidden>
Date: 2016-06-15 22:45:32

On Sun, Oct 26, 2008 at 9:30 PM, Junio C Hamano [off-list ref] wrote:
"David M. Syzdek" [off-list ref] writes:
quoted
This adds NO_UINTMAX_T for ancient systems. If NO_UINTMAX_T is defined, then
uintmax_t is defined as uint32_t. This adds a test to configure.ac for
uintmax_t and adds a check to the Makefile for FreeBSD 4.9-SECURITY.
...
diff --git a/Makefile b/Makefile
index 0d40f0e..bf6a6dc 100644
--- a/Makefile
+++ b/Makefile
@@ -931,6 +931,9 @@ endif
 ifdef NO_IPV6
      BASIC_CFLAGS += -DNO_IPV6
 endif
+ifdef NO_UINTMAX_T
+     BASIC_CFLAGS += -Duintmax_t=uint32_t
+endif
I have a stupid question.

Would it be a more appropriate improvement to do it like this:

       ifdef USE_THIS_AS_UINTMAX_T
           BASIC_CFLAGS += -Duintmax_t="$(USE_THIS_AS_UINTMAX_T)"
       endif

and then add a section for FreeBSD 4.9-SECURITY like this:

       ifeq ($(uname_R),4.9-SECURITY)
               USE_THIS_AS_UINTMAX_T = uint32_t
       endif

That way, an oddball 64-bit machine can use uint64_t here if it wants to,
possibly including FreeBSD 4.9-SECURITY backported to 64-bit ;-).
Your suggestion provides more flexibility for other environments. I
was making the assumption that 64-bit systems would define uintmax_t,
however in retrospect that would be unwise.
Would you like me to resubmit the patches with your modifications?


--
An earthquake wiped out Etchisketchistan today.
  -- Onion TV
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help