2010-03-07 Bruno Haible <bruno@clisp.org>
+ 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.
/* A substitute for ISO C99 <ctype.h>, 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
#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
Depends-on:
include_next
+c++defs
warn-on-use
configure.ac:
# We need the following in order to create <ctype.h> 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' \
-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 && \