From a6b59791abe6c0dd03ffd70edb8fbe6460ad8971 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 17 Mar 2003 12:20:07 -0500 Subject: [PATCH] [svn-r6485] Purpose: Bug Fix Description: "using namespace std" isn't supported on HP-UX. We ahve the H5_NO_STD flag begin set, but it wasn't being used. Solution: Added the check to the #ifdef line to see if H5_NO_STD is defined before trying to use it in the program. Platforms tested: Kelgia --- c++/examples/chunks.cpp | 2 +- c++/examples/compound.cpp | 2 +- c++/examples/create.cpp | 2 +- c++/examples/extend_ds.cpp | 2 +- c++/examples/h5group.cpp | 2 +- c++/examples/readdata.cpp | 2 +- c++/examples/writedata.cpp | 2 +- c++/src/H5Exception.cpp | 2 ++ c++/src/H5Exception.h | 4 +++- 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 2f1d5a856e..44d543ef81 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -18,7 +18,7 @@ */ #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index c48059998d..c559eb7037 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -19,7 +19,7 @@ */ #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index 6ccba16fc6..219d771c2c 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -17,7 +17,7 @@ // #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index 0da1df4444..f6f5691ac0 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -20,7 +20,7 @@ */ #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 6883c699cd..301d38372f 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -21,7 +21,7 @@ // the C version is used in this example. // #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 7facebdace..0805fa5a90 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -19,7 +19,7 @@ // #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index 1f503faefc..ed0268b889 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -22,7 +22,7 @@ */ #include -#ifndef H5_NO_NAMESPACE +#if !defined(H5_NO_NAMESPACE) && !defined(H5_NO_STD) using namespace std; #endif diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 81987c291e..c61e252a19 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -23,7 +23,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { +#ifndef H5_NO_STD using namespace std; +#endif // H5_NO_STD #endif // Default constructor diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 61fc261ff9..a77400e6cf 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -20,7 +20,9 @@ #ifndef H5_NO_NAMESPACE namespace H5 { -using namespace std; +#ifndef H5_NO_STD + using namespace std; +#endif // H5_NO_STD #endif class H5_DLLCPP Exception {