[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-7.1 - Compile Issue - Assuming defined preprocessor symbol
From: |
Bruno Haible |
Subject: |
Re: coreutils-7.1 - Compile Issue - Assuming defined preprocessor symbols have a value |
Date: |
Fri, 27 Feb 2009 16:52:13 +0100 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> > In lib/inttypes.in.h the following line appears 4 times:
> >
> > # if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @INT64_MAX_EQ_LONG_MAX@)
> >
> > The problem arises if _LP64 is defined but does not have a value.
>
> Thanks for the report. This is indeed a bug in the gnulib replacement
> header. Does replacing '_LP64' with 'defined _LP64' fix things?
According to the description, yes, replacing '_LP64' with 'defined _LP64'
will fix the mentioned problem. So this is the right thing to do for
Solaris.
And on Apple MacOS X 10.5, the headers also test whether _LP64 is defined,
not its value. So I'm applying this:
2009-02-27 Bruno Haible <address@hidden>
* lib/inttypes.in.h: Test merely whether _LP64 is defined, not its
value.
* lib/stdint.in.h: Likewise.
Suggested by Eric Blake. Reported by Peter Bray <address@hidden>.
--- lib/inttypes.in.h.orig 2009-02-27 16:47:02.000000000 +0100
+++ lib/inttypes.in.h 2009-02-27 16:46:34.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2008 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2009 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
@@ -168,7 +168,7 @@
# endif
# endif
# ifdef INT64_MAX
-# if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
# define _PRI64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _PRI64_PREFIX "I64"
@@ -185,7 +185,7 @@
# endif
# endif
# ifdef UINT64_MAX
-# if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
# define _PRIu64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _PRIu64_PREFIX "I64"
@@ -661,7 +661,7 @@
# endif
# endif
# ifdef INT64_MAX
-# if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
# define _SCN64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _SCN64_PREFIX "I64"
@@ -678,7 +678,7 @@
# endif
# endif
# ifdef UINT64_MAX
-# if (@APPLE_UNIVERSAL_BUILD@ ? _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
# define _SCNu64_PREFIX "l"
# elif defined _MSC_VER || defined __MINGW32__
# define _SCNu64_PREFIX "I64"
--- lib/stdint.in.h.orig 2009-02-27 16:47:02.000000000 +0100
+++ lib/stdint.in.h 2009-02-27 16:46:04.000000000 +0100
@@ -435,7 +435,7 @@
#undef PTRDIFF_MIN
#undef PTRDIFF_MAX
#if @APPLE_UNIVERSAL_BUILD@
-# if _LP64
+# ifdef _LP64
# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
# else
@@ -463,7 +463,7 @@
/* size_t limit */
#undef SIZE_MAX
#if @APPLE_UNIVERSAL_BUILD@
-# if _LP64
+# ifdef _LP64
# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
# else
# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)