# HG changeset patch # User Bruno Haible # Date 1268005621 -3600 # Node ID c71f3c9363b0bf2fb01447a6e8f955f5eee8083c # Parent ab37e90dc2cd4137fe4986641166c9293babce10 ctype: Make it usable in C++ code. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-03-07 Bruno Haible + ctype: Make it usable in C++ code. + * lib/ctype.in.h: Include c++defs.h. + (isblank): Declare as extern "C". + * modules/ctype (Depends-on): Add c++defs. + (Makefile.am): Update ctype.h rule. + New module 'c++defs'. * modules/c++defs: New file. * build-aux/c++defs.h: New file. diff --git a/lib/ctype.in.h b/lib/ctype.in.h --- a/lib/ctype.in.h +++ b/lib/ctype.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms on which it is incomplete. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,12 +36,14 @@ #ifndef _GL_CTYPE_H #define _GL_CTYPE_H +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + /* The definition of _GL_WARN_ON_USE is copied here. */ /* Return non-zero if c is a blank, i.e. a space or tab character. */ #if @GNULIB_ISBLANK@ # if !@HAVE_ISBLANK@ -extern int isblank (int c); +_GL_EXTERN_C int isblank (int c); # endif #elif defined GNULIB_POSIXCHECK # undef isblank diff --git a/modules/ctype b/modules/ctype --- a/modules/ctype +++ b/modules/ctype @@ -7,6 +7,7 @@ Depends-on: include_next +c++defs warn-on-use configure.ac: @@ -17,7 +18,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -ctype.h: ctype.in.h $(WARN_ON_USE_H) +ctype.h: ctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -25,6 +26,7 @@ -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \ -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \ -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/ctype.in.h; \ } > $@-t && \