git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Work around missing strtoumax on Solaris.
@ 2007-02-19  7:36 Shawn O. Pearce
  0 siblings, 0 replies; only message in thread
From: Shawn O. Pearce @ 2007-02-19  7:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Solaris 9 apparently lacks the strtoumax function in its C library.
But it does have strtoull and uintmax_t appears to be defined to
be unsigned long long.

We now set NO_STRTOUMAX in the Makefile for SunOS systems, and
if this is set define strtoumax to be strtoull.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---

 Too bad I missed 1.5.0.1!  Time for 1.5.0.2 ?  ;-)

 Makefile          |    6 ++++++
 git-compat-util.h |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index ebecbbd..e8a827d 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,8 @@ all::
 #
 # Define NO_STRLCPY if you don't have strlcpy.
 #
+# Define NO_STRTOUMAX if you don't have strtoumax.
+#
 # Define NO_SETENV if you don't have setenv in the C library.
 #
 # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
@@ -348,6 +350,7 @@ ifeq ($(uname_S),SunOS)
 	NEEDS_NSL = YesPlease
 	SHELL_PATH = /bin/bash
 	NO_STRCASESTR = YesPlease
+	NO_STRTOUMAX = YesPlease
 	ifeq ($(uname_R),5.8)
 		NEEDS_LIBICONV = YesPlease
 		NO_UNSETENV = YesPlease
@@ -517,6 +520,9 @@ ifdef NO_STRLCPY
 	COMPAT_CFLAGS += -DNO_STRLCPY
 	COMPAT_OBJS += compat/strlcpy.o
 endif
+ifdef NO_STRTOUMAX
+	COMPAT_CFLAGS += -DNO_STRTOUMAX
+endif
 ifdef NO_SETENV
 	COMPAT_CFLAGS += -DNO_SETENV
 	COMPAT_OBJS += compat/setenv.o
diff --git a/git-compat-util.h b/git-compat-util.h
index 105ac28..f812f8e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -139,6 +139,10 @@ extern char *gitstrcasestr(const char *haystack, const char *needle);
 extern size_t gitstrlcpy(char *, const char *, size_t);
 #endif
 
+#ifdef NO_STRTOUMAX
+#define strtoumax strtoull
+#endif
+
 extern void release_pack_memory(size_t);
 
 static inline char* xstrdup(const char *str)
-- 
1.5.0.552.ge1b1c

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-19  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-19  7:36 [PATCH] Work around missing strtoumax on Solaris Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).