bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* sys-limits.h on illumos
@ 2019-01-03 23:52 Andy Fiddaman
  2019-01-04  5:26 ` Bruno Haible
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Fiddaman @ 2019-01-03 23:52 UTC (permalink / raw)
  To: bug-gnulib


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?

Thanks,

Andy



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sys-limits.h on illumos
  2019-01-03 23:52 sys-limits.h on illumos Andy Fiddaman
@ 2019-01-04  5:26 ` Bruno Haible
  2019-01-04  6:41   ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Bruno Haible @ 2019-01-04  5:26 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Andy Fiddaman

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  <bruno@clisp.org>

	safe-read, safe-write: Fix conflict with Illumos-Joyent <sys/limits.h>.
	Reported by Andy Fiddaman <andy@omniosce.org>.
	* 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 <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_LIMITS_H
-#define _SYS_LIMITS_H
+#ifndef _GL_SYS_LIMITS_H
+#define _GL_SYS_LIMITS_H
 
 #include <limits.h>
 



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: sys-limits.h on illumos
  2019-01-04  5:26 ` Bruno Haible
@ 2019-01-04  6:41   ` Paul Eggert
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Eggert @ 2019-01-04  6:41 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib; +Cc: Andy Fiddaman

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]

I looked for similar problems on Solaris 11 and found a couple of potential name 
clashes, fixed as per attached.

[-- Attachment #2: 0001-bitset-crypto-gc-fix-conflicts-with-Solaris-11.patch --]
[-- Type: text/x-patch, Size: 2128 bytes --]

From df8874aaf70104f80dd83e27de73bdb6951dfb39 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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 <sys/bitset.h>.
* lib/gc.h (_GL_GC_H): Rename from GC_H, to avoid clash
with Solaris 11 <xorg/gc.h>.
---
 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  <eggert@cs.ucla.edu>
+
+	bitset, crypto/gc: fix conflicts with Solaris 11
+	* lib/bitset.h (_GL_BITSET_H): Rename from _BITSET_H, to
+	avoid clash with Solaris 11 <sys/bitset.h>.
+	* lib/gc.h (_GL_GC_H): Rename from GC_H, to avoid clash
+	with Solaris 11 <xorg/gc.h>.
+
 2019-01-04  Bruno Haible  <bruno@clisp.org>
 
 	safe-read, safe-write: Fix conflict with Illumos-Joyent <sys/limits.h>.
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 <http://www.gnu.org/licenses/>.  */
 
-#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 <stddef.h>
@@ -321,4 +321,4 @@ gc_pbkdf2_sha1 (const char *P, size_t Plen,
   Simon
  */
 
-#endif /* GC_H */
+#endif /* _GL_GC_H */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-04  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 23:52 sys-limits.h on illumos Andy Fiddaman
2019-01-04  5:26 ` Bruno Haible
2019-01-04  6:41   ` Paul Eggert

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 read-only IMAP folder(s) and NNTP newsgroup(s).