bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] stdint vs cycle-check.h


From: Bruno Haible
Subject: Re: [bug-gnulib] stdint vs cycle-check.h
Date: Tue, 27 Jun 2006 15:09:29 +0200
User-agent: KMail/1.9.1

Mark D. Baushke wrote:
> A system without an <stdint.h> file, will have the stdint_.h turned into
> a valid one. However, the HAVE_STDINT_H will not be defined. This causes
> problems with files like cycle-check.h which does:
> 
> # if HAVE_STDINT_H
> #  include <stdint.h>
> # endif

This by itself is not a problem. cycle-check.h uses this idiom to get a
reasonable definition of uintmax_t. If the system's <stdint.h> is
nonexistent or collides with <sys/types.h>, this #include is a nop, no
problem.

One problem I can see, however, is a collision between the uintmax_t
definition put into config.h by uintmax_t.m4 and the 'stdint' module.

> Similar things happen with these lib/*.h files:
> 
>   size_max.h xsize.h

These don't present a problem, because the definition of SIZE_MAX is
guarded with a #ifndef.

I'm committing this workaround.

Bruno


*** stdint_.h   26 Jun 2006 19:49:51 -0000      1.25
--- stdint_.h   27 Jun 2006 13:09:30 -0000
***************
*** 261,266 ****
--- 261,268 ----
     public header files. */
  
  #if address@hidden@
+ /* Remove possible redundant definition from gnulib's config.h first.  */
+ # undef intmax_t
  # ifdef _STDINT_H_HAVE_INT64
  typedef int64_t  intmax_t;
  # else
***************
*** 268,273 ****
--- 270,277 ----
  # endif
  #endif
  #if address@hidden@
+ /* Remove possible redundant definition from gnulib's config.h first.  */
+ # undef uintmax_t
  # ifdef _STDINT_H_HAVE_UINT64
  typedef uint64_t uintmax_t;
  # else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]