This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
gettext compilation error (2)
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: gettext compilation error (2)
- From: Bruno Haible <haible at ilog dot fr>
- Date: Tue, 25 Apr 2000 13:49:24 +0200 (MET DST)
Trying to compile glibc's intl package outside glibc, without iconv, I also
get the following errors.
gcc -c -DLOCALEDIR=\"/usr/local/share/locale\" -DGNULOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../../intl -I../../lib -g -O2 ../../intl/bindtextdom.c
../../intl/bindtextdom.c:69: storage class specified for parameter `type name'
../../intl/bindtextdom.c:69: parse error before `_nl_state_lock'
gcc -c -DLOCALEDIR=\"/usr/local/share/locale\" -DGNULOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../../intl -I../../lib -g -O2 ../../intl/dcigettext.c
../../intl/dcigettext.c:312: parse error before `,'
gcc -c -DLOCALEDIR=\"/usr/local/share/locale\" -DGNULOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../../intl -I../../lib -g -O2 ../../intl/textdomain.c
../../intl/textdomain.c:77: storage class specified for parameter `type name'
../../intl/textdomain.c:77: parse error before `_nl_state_lock'
gcc -c -DLOCALEDIR=\"/usr/local/share/locale\" -DGNULOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../../intl -I../../lib -g -O2 ../../intl/loadmsgcat.c
../../intl/loadmsgcat.c: In function `_nl_load_domain':
../../intl/loadmsgcat.c:286: `_nl_current' undeclared (first use in this function)
2000-04-23 Bruno Haible <clisp.cons.org>
* intl/bindtextdom.c [!_LIBC]: Define __libc_rwlock_define,
__libc_rwlock_wrlock, __libc_rwlock_unlock as empty.
* intl/textdomain.c [!_LIBC]: Likewise.
* intl/dcigettext.c [!_LIBC]: Define __libc_rwlock_define_initialized,
__libc_rwlock_rdlock, __libc_rwlock_unlock as empty.
* intl/loadmsgcat.c (_nl_load_domain) [!_LIBC, !HAVE_ICONV]: Avoid
syntax error.
*** intl/bindtextdom.c.bak Mon Feb 28 11:34:03 2000
--- intl/bindtextdom.c Sun Apr 23 18:10:05 2000
***************
*** 52,60 ****
# include <bits/libc-lock.h>
#else
/* Provide dummy implementation if this is outside glibc. */
! # define __libc_lock_define_initialized (CLASS, NAME)
! # define __libc_lock_lock(NAME)
! # define __libc_lock_unlock(NAME)
#endif
/* @@ end of prolog @@ */
--- 52,60 ----
# include <bits/libc-lock.h>
#else
/* Provide dummy implementation if this is outside glibc. */
! # define __libc_rwlock_define(CLASS, NAME)
! # define __libc_rwlock_wrlock(NAME)
! # define __libc_rwlock_unlock(NAME)
#endif
/* @@ end of prolog @@ */
*** intl/textdomain.c.bak Mon Feb 28 11:34:06 2000
--- intl/textdomain.c Sun Apr 23 18:21:00 2000
***************
*** 46,54 ****
# include <bits/libc-lock.h>
#else
/* Provide dummy implementation if this is outside glibc. */
! # define __libc_lock_define_initialized (CLASS, NAME)
! # define __libc_lock_lock(NAME)
! # define __libc_lock_unlock(NAME)
#endif
/* @@ end of prolog @@ */
--- 46,54 ----
# include <bits/libc-lock.h>
#else
/* Provide dummy implementation if this is outside glibc. */
! # define __libc_rwlock_define(CLASS, NAME)
! # define __libc_rwlock_wrlock(NAME)
! # define __libc_rwlock_unlock(NAME)
#endif
/* @@ end of prolog @@ */
*** intl/dcigettext.c.bak Mon Feb 28 11:34:03 2000
--- intl/dcigettext.c Sun Apr 23 18:41:13 2000
***************
*** 98,106 ****
# include <bits/libc-lock.h>
#else
/* Provide dummy implementation if this is outside glibc. */
! # define __libc_lock_define_initialized (CLASS, NAME)
# define __libc_lock_lock(NAME)
# define __libc_lock_unlock(NAME)
#endif
/* @@ end of prolog @@ */
--- 98,109 ----
# include <bits/libc-lock.h>
#else
/* Provide dummy implementation if this is outside glibc. */
! # define __libc_lock_define_initialized(CLASS, NAME)
# define __libc_lock_lock(NAME)
# define __libc_lock_unlock(NAME)
+ # define __libc_rwlock_define_initialized(CLASS, NAME)
+ # define __libc_rwlock_rdlock(NAME)
+ # define __libc_rwlock_unlock(NAME)
#endif
/* @@ end of prolog @@ */
*** intl/loadmsgcat.c.bak Mon Feb 28 11:34:06 2000
--- intl/loadmsgcat.c Sun Apr 23 18:39:06 2000
***************
*** 257,266 ****
nullentry = _nl_find_msg (domain_file, "", 0);
if (nullentry != NULL)
{
! const char *charsetstr = strstr (nullentry, "charset=");
const char *plural;
const char *nplurals;
if (charsetstr != NULL)
{
size_t len;
--- 257,268 ----
nullentry = _nl_find_msg (domain_file, "", 0);
if (nullentry != NULL)
{
! const char *charsetstr;
const char *plural;
const char *nplurals;
+ #if defined _LIBC || HAVE_ICONV
+ charsetstr = strstr (nullentry, "charset=");
if (charsetstr != NULL)
{
size_t len;
***************
*** 271,282 ****
len = strcspn (charsetstr, " \t\n");
charset = (char *) alloca (len + 1);
! #if defined _LIBC || HAVE_MEMPCPY
*((char *) mempcpy (charset, charsetstr, len)) = '\0';
! #else
memcpy (charset, charsetstr, len);
charset[len] = '\0';
! #endif
/* The output charset should normally be determined by the
locale. But sometimes the locale is not used or not correctly
--- 273,284 ----
len = strcspn (charsetstr, " \t\n");
charset = (char *) alloca (len + 1);
! # if defined _LIBC || HAVE_MEMPCPY
*((char *) mempcpy (charset, charsetstr, len)) = '\0';
! # else
memcpy (charset, charsetstr, len);
charset[len] = '\0';
! # endif
/* The output charset should normally be determined by the
locale. But sometimes the locale is not used or not correctly
***************
*** 285,301 ****
if (outcharset == NULL || outcharset[0] == '\0')
outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
! #ifdef _LIBC
if (__gconv_open (outcharset, charset, &domain->conv,
GCONV_AVOID_NOCONV)
!= __GCONV_OK)
domain->conv = (__gconv_t) -1;
! #else
! # if HAVE_ICONV
domain->conv = iconv_open (outcharset, charset);
# endif
- #endif
}
/* Also look for a plural specification. */
plural = strstr (nullentry, "plural=");
--- 287,304 ----
if (outcharset == NULL || outcharset[0] == '\0')
outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
! # ifdef _LIBC
if (__gconv_open (outcharset, charset, &domain->conv,
GCONV_AVOID_NOCONV)
!= __GCONV_OK)
domain->conv = (__gconv_t) -1;
! # else
! # if HAVE_ICONV
domain->conv = iconv_open (outcharset, charset);
+ # endif
# endif
}
+ #endif /* _LIBC || HAVE_ICONV */
/* Also look for a plural specification. */
plural = strstr (nullentry, "plural=");