From 4b495648eda27836632c9c43ebb5847ccb2baf0a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 8 Mar 2010 00:47:01 +0100 Subject: [PATCH] ctype: Make it usable in C++ code. --- ChangeLog | 6 ++++++ lib/ctype.in.h | 6 ++++-- modules/ctype | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b5e5ccda..7297b2a83 100644 --- 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 index c9b1063cd..ccf222d76 100644 --- 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 index 2cd1fb0cc..be01f0c7f 100644 --- a/modules/ctype +++ b/modules/ctype @@ -7,6 +7,7 @@ m4/ctype.m4 Depends-on: include_next +c++defs warn-on-use configure.ac: @@ -17,7 +18,7 @@ BUILT_SOURCES += ctype.h # 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 @@ ctype.h: ctype.in.h $(WARN_ON_USE_H) -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 && \ -- 2.11.0