{"thread":{"id":"6876","subject":"[PATCH] Work around missing strtoumax on Solaris.","startedAt":"2007-02-19T07:36:13Z","lastAt":"2007-02-19T07:36:13Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"34980","messageId":"20070219073613.GA30144@spearce.org","threadId":"6876","inReplyTo":null,"subject":"[PATCH] Work around missing strtoumax on Solaris.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-19T07:36:13Z","receivedAt":"2007-02-19T07:36:13Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Solaris 9 apparently lacks the strtoumax function in its C library.\nBut it does have strtoull and uintmax_t appears to be defined to\nbe unsigned long long.\n\nWe now set NO_STRTOUMAX in the Makefile for SunOS systems, and\nif this is set define strtoumax to be strtoull.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n Too bad I missed 1.5.0.1!  Time for 1.5.0.2 ?  ;-)\n\n Makefile          |    6 ++++++\n git-compat-util.h |    4 ++++\n 2 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ebecbbd..e8a827d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -28,6 +28,8 @@ all::\n #\n # Define NO_STRLCPY if you don't have strlcpy.\n #\n+# Define NO_STRTOUMAX if you don't have strtoumax.\n+#\n # Define NO_SETENV if you don't have setenv in the C library.\n #\n # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.\n@@ -348,6 +350,7 @@ ifeq ($(uname_S),SunOS)\n \tNEEDS_NSL = YesPlease\n \tSHELL_PATH = /bin/bash\n \tNO_STRCASESTR = YesPlease\n+\tNO_STRTOUMAX = YesPlease\n \tifeq ($(uname_R),5.8)\n \t\tNEEDS_LIBICONV = YesPlease\n \t\tNO_UNSETENV = YesPlease\n@@ -517,6 +520,9 @@ ifdef NO_STRLCPY\n \tCOMPAT_CFLAGS += -DNO_STRLCPY\n \tCOMPAT_OBJS += compat/strlcpy.o\n endif\n+ifdef NO_STRTOUMAX\n+\tCOMPAT_CFLAGS += -DNO_STRTOUMAX\n+endif\n ifdef NO_SETENV\n \tCOMPAT_CFLAGS += -DNO_SETENV\n \tCOMPAT_OBJS += compat/setenv.o\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 105ac28..f812f8e 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -139,6 +139,10 @@ extern char *gitstrcasestr(const char *haystack, const char *needle);\n extern size_t gitstrlcpy(char *, const char *, size_t);\n #endif\n \n+#ifdef NO_STRTOUMAX\n+#define strtoumax strtoull\n+#endif\n+\n extern void release_pack_memory(size_t);\n \n static inline char* xstrdup(const char *str)\n-- \n1.5.0.552.ge1b1c\n"}]}