+2008-01-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Backport ISO C++ support from HEAD, 2006-03-17 and 2005-09-12 patches.
+
+ * tagdemo/configure.ac (HAVE_NAMESPACES, HAVE_IOSTREAM):
+ New tests for ISO C++ features. Reimplementation of similar
+ macros from the autoconf archive.
+ * tagdemo/foo.cpp, tagdemo/main.cpp: Adjusted. Provide dummy
+ `std' namespace for the HPPA C++ compiler.
+
2008-01-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.am (fetch): Update to match upstream git sources.
## Process this file with autoconf to create configure. -*- autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2008 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
AC_PROG_CXX
AC_PROG_CXXCPP
+# Check for namespace support and new-style headers
+AC_LANG_PUSH([C++])
+AC_MSG_CHECKING([whether the compiler implements namespaces])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[namespace A { namespace B { int i = 0; }}]],
+ [[using namespace A::B; return i;]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_NAMESPACES],[1],
+ [define if the compiler implements namespaces])],
+ [AC_MSG_RESULT([no])])
+
+AC_MSG_CHECKING([whether the compiler has ISO C++ iostream])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <iostream>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif ]], [[cout << "bingo\n"; return 0;]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_IOSTREAM],[1],
+ [define if the compiler has ISO C++ iostream])],
+ [AC_MSG_RESULT([no])])
+AC_LANG_POP([C++])
+
+
# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and
# AC_EXEEXT macros only works for C compilers!
# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting
// -*- C++ -*-
// foo.cpp -- trivial test library
-// Copyright (C) 1998-2000 Free Software Foundation, Inc.
+// Copyright (C) 1998-2000, 2008 Free Software Foundation, Inc.
// Originally by Thomas Tanner <tanner@ffii.org>
// This file is part of GNU Libtool.
// USA.
#include "foo.h"
-#include <iostream.h>
+#ifdef HAVE_IOSTREAM
+# include <iostream>
+#else
+# include <iostream.h>
+#endif
+#ifdef HAVE_NAMESPACES
+namespace std { }
+using namespace std;
+#endif
#ifdef HAVE_MATH_H
#include <math.h>
// -*- C++ -*-
// main.cpp -- tagdemo test program
-// Copyright (C) 1998-2000 Free Software Foundation, Inc.
+// Copyright (C) 1998-2000, 2008 Free Software Foundation, Inc.
// Originally by Thomas Tanner <tanner@ffii.org>
// This file is part of GNU Libtool.
#include "foo.h"
#include "baz.h"
-#include <iostream.h>
+#ifdef HAVE_IOSTREAM
+# include <iostream>
+#else
+# include <iostream.h>
+#endif
+#ifdef HAVE_NAMESPACES
+namespace std { }
+using namespace std;
+#endif
int