Re: sys-limits.h on illumos

2019-01-03 Thread Paul Eggert
I looked for similar problems on Solaris 11 and found a couple of potential name 
clashes, fixed as per attached.
>From df8874aaf70104f80dd83e27de73bdb6951dfb39 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 3 Jan 2019 22:36:21 -0800
Subject: [PATCH] bitset, crypto/gc: fix conflicts with Solaris 11

* lib/bitset.h (_GL_BITSET_H): Rename from _BITSET_H, to
avoid clash with Solaris 11 .
* lib/gc.h (_GL_GC_H): Rename from GC_H, to avoid clash
with Solaris 11 .
---
 ChangeLog| 8 
 lib/bitset.h | 6 +++---
 lib/gc.h | 6 +++---
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01493c2e0..3258b12d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-01-03  Paul Eggert  
+
+	bitset, crypto/gc: fix conflicts with Solaris 11
+	* lib/bitset.h (_GL_BITSET_H): Rename from _BITSET_H, to
+	avoid clash with Solaris 11 .
+	* lib/gc.h (_GL_GC_H): Rename from GC_H, to avoid clash
+	with Solaris 11 .
+
 2019-01-04  Bruno Haible  
 
 	safe-read, safe-write: Fix conflict with Illumos-Joyent .
diff --git a/lib/bitset.h b/lib/bitset.h
index a2e9c0371..32d08e7aa 100644
--- a/lib/bitset.h
+++ b/lib/bitset.h
@@ -17,8 +17,8 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
-#ifndef _BITSET_H
-#define _BITSET_H
+#ifndef _GL_BITSET_H
+#define _GL_BITSET_H
 
 /* This file is the public interface to the bitset abstract data type.
Only use the functions and macros defined in this file.  */
@@ -385,4 +385,4 @@ void debug_bitset (bitset);
 /* Function to debug bitset stats from debugger.  */
 void debug_bitset_stats (void);
 
-#endif /* _BITSET_H  */
+#endif /* _GL_BITSET_H  */
diff --git a/lib/gc.h b/lib/gc.h
index 664bb9e14..b5f8327dc 100644
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -16,8 +16,8 @@
  *
  */
 
-#ifndef GC_H
-# define GC_H
+#ifndef _GL_GC_H
+# define _GL_GC_H
 
 /* Get size_t. */
 # include 
@@ -321,4 +321,4 @@ gc_pbkdf2_sha1 (const char *P, size_t Plen,
   Simon
  */
 
-#endif /* GC_H */
+#endif /* _GL_GC_H */
-- 
2.17.1



Re: sys-limits.h on illumos

2019-01-03 Thread Bruno Haible
Hi,

Andy Fiddaman wrote:
> There's a compatibility problem with the guard definition used in the
> sys-limits.h file that affects illumos (an opensolaris derivative) and most
> likely Solaris too.
> 
> These operating systems have a /usr/include/sys/limits.h file which uses the
> _SYS_LIMITS_H guard. Since the same guard is used in the gnulib sys-limits.h,
> we are finding that as packages update their copies of gnulib, compilation
> breaks (most recently we experienced this with coreutils, grep and tar -
> usually the symptom is that SYS_BUFSIZE_MAX is not defined).
> 
> Would it be possible to replace _SYS_LIMITS_H in sys-limits.h with something
> else in order to resolve this problem?

It affects only the Joyent fork of Illumos, as you can see from
https://github.com/joyent/illumos-joyent/tree/master/usr/src/uts/common/sys
vs.
https://github.com/illumos/illumos-gate/tree/master/usr/src/uts/common/sys

It does NOT affect Solaris 11.4, nor OpenIndiana, since these systems don't
have a /usr/include/sys/limits.h file.


Done:

2019-01-04  Bruno Haible  

safe-read, safe-write: Fix conflict with Illumos-Joyent .
Reported by Andy Fiddaman .
* lib/sys-limits.h: Add a '_GL' prefix to the guard symbol.

diff --git a/lib/sys-limits.h b/lib/sys-limits.h
index 2f09bbf..12611b5 100644
--- a/lib/sys-limits.h
+++ b/lib/sys-limits.h
@@ -15,8 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .  */
 
-#ifndef _SYS_LIMITS_H
-#define _SYS_LIMITS_H
+#ifndef _GL_SYS_LIMITS_H
+#define _GL_SYS_LIMITS_H
 
 #include