bug-gnulib
[Top][All Lists]
Advanced

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

#ifndef _GL_WCHAR_H in lib/wchar.in.h


From: Albert Chin
Subject: #ifndef _GL_WCHAR_H in lib/wchar.in.h
Date: Wed, 14 Jan 2009 12:26:14 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

Why does lib/wchar.in.h have:
  #ifndef _GL_WCHAR_H
  ...
  #ifndef _GL_WCHAR_H
  #define _GL_WCHAR_H
rather than just:
  #ifndef _GL_WCHAR_H
  #define _GL_WCHAR_H

This causes a problem on HP-UX 11.00 because <wchar.h> is included more
than once.
  $ ./gnulib-tool --create-testdir --dir=t arpa_inet crypto/md5 \
  environ filemode fnmatch fnmatch-gnu getdate gettext glob human \
  iconv_open inet_pton lstat mbswidth memmem mktime modechange poll \
  regex socklen strcase strftime strptime strtok_r vsnprintf \
  vsnprintf-posix wcwidth
  $ cd t
  $ ./configure
  $ gmake
  ...
  cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -c -o btowc.o btowc.c
  cc: "wchar.h", line 124: error 1000: Unexpected symbol: "btowc".
  cc: panic 2017: Cannot recover from earlier errors, terminating.
  gmake[4]: *** [btowc.o] Error 1

  $ cd gllib

  $ cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -E btowc.c | grep wchar.h
  # 1 "./wchar.h"
  # 49 "./wchar.h"
  # 50 "./wchar.h"
  # 51 "./wchar.h"
  # 1 "///usr/include/wchar.h"
  # 33 "///usr/include/wchar.h"
  # 1 "./wchar.h"
  # 49 "./wchar.h"
  # 50 "./wchar.h"
  # 51 "./wchar.h"
  # 1 "///usr/include/wchar.h"
  # 57 "./wchar.h"
  # 1 "./wchar.h"
  # 42 "///usr/include/wchar.h"
  # 57 "./wchar.h"

  $ cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -E btowc.c | \
  grep wint_t | head -2
  extern wint_t btowc (int c);
     typedef unsigned int wint_t;

Applying the attached patch fixes this:
  $ cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -E btowc.c | grep wchar.h
  # 1 "./wchar.h"
  # 50 "./wchar.h"
  # 51 "./wchar.h"
  # 52 "./wchar.h"
  # 1 "///usr/include/wchar.h"
  # 33 "///usr/include/wchar.h"
  # 1 "./wchar.h"
  # 1 "./wchar.h"
  # 42 "///usr/include/wchar.h"
  # 58 "./wchar.h"

  $ cc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -E btowc.c | \
  grep wint_t | head -2
     typedef unsigned int wint_t;
   ...
  extern wint_t btowc (int c);

-- 
albert chin (address@hidden)

Attachment: d
Description: Text document


reply via email to

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