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

Re: [PATCH 2/2] t8005: convert CP1251 character set to ISO8859-5

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2009, 01:06 UTC
Message-ID
<7vhbzc4oht.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vskiw4ooe.fsf@alter.siamese.dyndns.org>

By the way, with the attached patch, I seem to be able to compile everything more or less cleanly on OpenSolaris (200811).

In git-compat-util.h, we do
    #define _XOPEN_SOURCE 600
    #define _XOPEN_SOURCE_EXTENDED 1
and their /usr/include/sys/feature_tests.h has this nice table:
    Feature Test Macro				     Specification
    ------------------------------------------------  -------------
    _XOPEN_SOURCE                                         XPG3
    _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4
    _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2
    _XOPEN_SOURCE = 500                                   XPG5
    _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6

Later in the same header, compilation with -c99 is made to fail if _XPG6 is not set, like this:

    #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
    #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
            and pre-2001 POSIX applications"
    #elif ...

The problem is that they check things in an order that is inconvenient for us. When they see _XOPEN_SOURCE_EXTENDED, they declare that we are XPG4v2 regardless of the value of _XOPEN_SOURCE.

It also appears that we do not need OLD_ICONV anymore, as our Makefile suggests for older releases.

It would be nice if people with older Solaris can check if I am not breaking things for them...

 Makefile          |    4 +++-
 git-compat-util.h |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index fdb39fa..e7fc399 100644
--- a/Makefile
+++ b/Makefile
@@ -701,7 +701,9 @@ ifeq ($(uname_S),SunOS)
 	NO_MEMMEM = YesPlease
 	NO_HSTRERROR = YesPlease
 	NO_MKDTEMP = YesPlease
-	OLD_ICONV = UnfortunatelyYes
+	ifneq ($(uname_R),5.11)
+		OLD_ICONV = UnfortunatelyYes
+	endif
 	ifeq ($(uname_R),5.8)
 		NO_UNSETENV = YesPlease
 		NO_SETENV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index c7cf2d5..4236647 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -41,8 +41,10 @@
 
 #if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
+#ifndef __sun__
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
+#endif
 #define _ALL_SOURCE 1
 #define _GNU_SOURCE 1
 #define _BSD_SOURCE 1
Previous: Junio C HamanoNext: Jeff King
Message 8 of 15 in “t8005: use more portable character encoding names”
  1. t8005: use more portable character encoding namesBrandon Casey, May 22, 2009
  2. Junio C HamanoMay 22, 2009
  3. Brandon CaseyMay 22, 2009
  4. Alex RiesenMay 22, 2009
  5. 1/2 t8005: use more portable character encoding namesBrandon Casey, May 22, 2009
  6. 2/2 t8005: convert CP1251 character set to ISO8859-5Brandon Casey, May 22, 2009
  7. Junio C HamanoMay 23, 2009
  8. Junio C HamanoMay 23, 2009
  9. Jeff KingMay 25, 2009
  10. Jeff KingMay 25, 2009
  11. Brandon CaseyMay 26, 2009
  12. Jeff KingMay 28, 2009
  13. Brandon CaseyMay 26, 2009
  14. Jeff KingMay 28, 2009
  15. Junio C HamanoMay 26, 2009

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.