git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 2, 2015, 21:15 UTC
Message-ID
<1433279744-23379-2-git-send-email-sunshine@sunshineco.com>
In-Reply-To
<1433279744-23379-1-git-send-email-sunshine@sunshineco.com>

On Mac OS X, getdelim() first became available with Xcode 4.1[1], which was released the same day as OS X 10.7 "Lion", so assume getdelim() availability from 10.7 onward. (As of this writing, OS X is at 10.10 "Yosemite".)

According to Wikipedia[2], 4.1 was also available for download by paying developers on OS X 10.6 "Snow Leopard", so it's possible that some 10.6 machines may have getdelim(). However, as strbuf's use of getdelim() is purely an optimization, let's be conservative and assume 10.6 and earlier lack getdelim().

[1]: Or, possibly with Xcode 4.0, but that version is no longer
     available for download, or not available to non-paying developers,
     so testing is not possible.
[2]: http://en.wikipedia.org/wiki/Xcode
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
 config.mak.uname | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index d26665f..943c439 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -102,6 +102,9 @@ ifeq ($(uname_S),Darwin)
 	ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
 		NO_STRLCPY = YesPlease
 	endif
+	ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
+		HAVE_GETDELIM = YesPlease
+	endif
 	NO_MEMMEM = YesPlease
 	USE_ST_TIMESPEC = YesPlease
 	HAVE_DEV_TTY = YesPlease
-- 
2.4.2.598.gb4379f4
Previous: Eric SunshineNext: Eric Sunshine
Message 2 of 4 in “auto-detect getdelim()”
  1. 0/2 auto-detect getdelim()Eric Sunshine, Jun 2, 2015
  2. 1/2 config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releasesEric Sunshine, Jun 2, 2015
  3. 2/2 configure: add getdelim() checkEric Sunshine, Jun 2, 2015
  4. Jeff KingJun 3, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.