1. The files in etc/config/src which are includes the
file BAD_ALLOC_ASSIGNMENT.cpp should be compiled after the
RUNTIME_IN_STD.cpp. The BAD_ALLOC_ASSIGNMENT.cpp itself
compiled after RUNTIME_IN_STD.cpp due to
"#ifndef _RWSTD_NO_RUNTIME_IN_STD" line.
2. The file TLS.cpp uses __thread modifier, but with MSVC (and
ICC/Windows as well) should used __declspec (thread) modifier.
I have been fixed it (the diff file is attached).
ChangeLog:
* BAD_ALLOC_COPY_CTOR.cpp: Added dependency on RUNTIME_IN_STD.cpp
* BAD_ALLOC_DEFAULT_CTOR.cpp: Ditto
* BAD_ALLOC_DTOR.cpp: Ditto
* BAD_ALLOC_WHAT.cpp: Ditto
* BAD_CAST_ASSIGNMENT.cpp: Ditto
* BAD_CAST_COPY_CTOR.cpp: Ditto
* BAD_CAST_DEFAULT_CTOR.cpp: Ditto
* BAD_CAST_DTOR.cpp: Ditto
* BAD_CAST_WHAT.cpp: Ditto
* BAD_EXCEPTION_ASSIGNMENT.cpp: Ditto
* BAD_EXCEPTION_COPY_CTOR.cpp: Ditto
* BAD_EXCEPTION_DEFAULT_CTOR.cpp: Ditto
* BAD_EXCEPTION_DTOR.cpp: Ditto
* BAD_EXCEPTION_WHAT.cpp: Ditto
* BAD_TYPEID_ASSIGNMENT.cpp: Ditto
* BAD_TYPEID_COPY_CTOR.cpp: Ditto
* BAD_TYPEID_DEFAULT_CTOR.cpp: Ditto
* BAD_TYPEID_DTOR.cpp: Ditto
* BAD_TYPEID_WHAT.cpp: Ditto
* EXCEPTION_ASSIGNMENT.cpp: Ditto
* EXCEPTION_COPY_CTOR.cpp: Ditto
* EXCEPTION_DEFAULT_CTOR.cpp: Ditto
* EXCEPTION_DTOR.cpp: Ditto
* EXCEPTION_WHAT.cpp: Ditto
* TLS.cpp [_MSC_VER]: Used modifier __declspec (thread) instead of
__thread
Also I see that THREAD_SAFE_ERRNO.cpp and THREAD_SAFE_EXCEPTIONS.cpp
are platform dependent and cannot be used on Windows. I not ported it
because I not found using of the _RWSTD_NO_THREAD_SAFE_ERRNO nor
_RWSTD_NO_THREAD_SAFE_EXCEPTIONS macros in the source files.
Farid.
Index: BAD_ALLOC_COPY_CTOR.cpp
===================================================================
--- BAD_ALLOC_COPY_CTOR.cpp (revision 449640)
+++ BAD_ALLOC_COPY_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_COPY_CTOR
#define main test_bad_alloc_copy_ctor
#include "BAD_ALLOC_ASSIGNMENT.cpp"
Index: BAD_ALLOC_DEFAULT_CTOR.cpp
===================================================================
--- BAD_ALLOC_DEFAULT_CTOR.cpp (revision 449640)
+++ BAD_ALLOC_DEFAULT_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DEFAULT_CTOR
#define main test_bad_alloc_default_ctor
#include "BAD_ALLOC_ASSIGNMENT.cpp"
Index: BAD_ALLOC_DTOR.cpp
===================================================================
--- BAD_ALLOC_DTOR.cpp (revision 449640)
+++ BAD_ALLOC_DTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DTOR
#define main test_bad_alloc_dtor
#include "BAD_ALLOC_ASSIGNMENT.cpp"
Index: BAD_ALLOC_WHAT.cpp
===================================================================
--- BAD_ALLOC_WHAT.cpp (revision 449640)
+++ BAD_ALLOC_WHAT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_WHAT
#define main test_bad_alloc_what
#include "BAD_ALLOC_ASSIGNMENT.cpp"
Index: BAD_CAST_ASSIGNMENT.cpp
===================================================================
--- BAD_CAST_ASSIGNMENT.cpp (revision 449640)
+++ BAD_CAST_ASSIGNMENT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_ASSIGNMENT
#define bad_alloc bad_cast
#define main test_bad_cast_assignment
Index: BAD_CAST_COPY_CTOR.cpp
===================================================================
--- BAD_CAST_COPY_CTOR.cpp (revision 449640)
+++ BAD_CAST_COPY_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_COPY_CTOR
#define bad_alloc bad_cast
#define main test_bad_cast_copy_ctor
Index: BAD_CAST_DEFAULT_CTOR.cpp
===================================================================
--- BAD_CAST_DEFAULT_CTOR.cpp (revision 449640)
+++ BAD_CAST_DEFAULT_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DEFAULT_CTOR
#define bad_alloc bad_cast
#define main test_bad_cast_default_ctor
Index: BAD_CAST_DTOR.cpp
===================================================================
--- BAD_CAST_DTOR.cpp (revision 449640)
+++ BAD_CAST_DTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DTOR
#define bad_alloc bad_cast
#define main test_bad_cast_dtor
Index: BAD_CAST_WHAT.cpp
===================================================================
--- BAD_CAST_WHAT.cpp (revision 449640)
+++ BAD_CAST_WHAT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_WHAT
#define bad_alloc bad_cast
#define main test_bad_cast_what
Index: BAD_EXCEPTION_ASSIGNMENT.cpp
===================================================================
--- BAD_EXCEPTION_ASSIGNMENT.cpp (revision 449640)
+++ BAD_EXCEPTION_ASSIGNMENT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_ASSIGNMENT
#define bad_alloc bad_exception
#define main test_bad_exception_assignment
Index: BAD_EXCEPTION_COPY_CTOR.cpp
===================================================================
--- BAD_EXCEPTION_COPY_CTOR.cpp (revision 449640)
+++ BAD_EXCEPTION_COPY_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_COPY_CTOR
#define bad_alloc bad_exception
#define main test_bad_exception_copy_ctor
Index: BAD_EXCEPTION_DEFAULT_CTOR.cpp
===================================================================
--- BAD_EXCEPTION_DEFAULT_CTOR.cpp (revision 449640)
+++ BAD_EXCEPTION_DEFAULT_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DEFAULT_CTOR
#define bad_alloc bad_exception
#define main test_bad_exception_default_ctor
Index: BAD_EXCEPTION_DTOR.cpp
===================================================================
--- BAD_EXCEPTION_DTOR.cpp (revision 449640)
+++ BAD_EXCEPTION_DTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DTOR
#define bad_alloc bad_exception
#define main test_bad_exception_dtor
Index: BAD_EXCEPTION_WHAT.cpp
===================================================================
--- BAD_EXCEPTION_WHAT.cpp (revision 449640)
+++ BAD_EXCEPTION_WHAT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_WHAT
#define bad_alloc bad_exception
#define main test_bad_exception_what
Index: BAD_TYPEID_ASSIGNMENT.cpp
===================================================================
--- BAD_TYPEID_ASSIGNMENT.cpp (revision 449640)
+++ BAD_TYPEID_ASSIGNMENT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_ASSIGNMENT
#define bad_alloc bad_typeid
#define main test_bad_typeid_assignment
Index: BAD_TYPEID_COPY_CTOR.cpp
===================================================================
--- BAD_TYPEID_COPY_CTOR.cpp (revision 449640)
+++ BAD_TYPEID_COPY_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_COPY_CTOR
#define bad_alloc bad_typeid
#define main test_bad_typeid_copy_ctor
Index: BAD_TYPEID_DEFAULT_CTOR.cpp
===================================================================
--- BAD_TYPEID_DEFAULT_CTOR.cpp (revision 449640)
+++ BAD_TYPEID_DEFAULT_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DEFAULT_CTOR
#define bad_alloc bad_typeid
#define main test_bad_typeid_default_ctor
Index: BAD_TYPEID_DTOR.cpp
===================================================================
--- BAD_TYPEID_DTOR.cpp (revision 449640)
+++ BAD_TYPEID_DTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DTOR
#define bad_alloc bad_typeid
#define main test_bad_typeid_dtor
Index: BAD_TYPEID_WHAT.cpp
===================================================================
--- BAD_TYPEID_WHAT.cpp (revision 449640)
+++ BAD_TYPEID_WHAT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_WHAT
#define bad_alloc bad_typeid
#define main test_bad_typeid_what
Index: EXCEPTION_ASSIGNMENT.cpp
===================================================================
--- EXCEPTION_ASSIGNMENT.cpp (revision 449640)
+++ EXCEPTION_ASSIGNMENT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_ASSIGNMENT
#define bad_alloc exception
#define main test_exception_assignment
Index: EXCEPTION_COPY_CTOR.cpp
===================================================================
--- EXCEPTION_COPY_CTOR.cpp (revision 449640)
+++ EXCEPTION_COPY_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_COPY_CTOR
#define bad_alloc exception
#define main test_exception_copy_ctor
Index: EXCEPTION_DEFAULT_CTOR.cpp
===================================================================
--- EXCEPTION_DEFAULT_CTOR.cpp (revision 449640)
+++ EXCEPTION_DEFAULT_CTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DEFAULT_CTOR
#define bad_alloc exception
#define main test_exception_default_ctor
Index: EXCEPTION_DTOR.cpp
===================================================================
--- EXCEPTION_DTOR.cpp (revision 449640)
+++ EXCEPTION_DTOR.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_DTOR
#define bad_alloc exception
#define main test_exception_dtor
Index: EXCEPTION_WHAT.cpp
===================================================================
--- EXCEPTION_WHAT.cpp (revision 449640)
+++ EXCEPTION_WHAT.cpp (working copy)
@@ -4,6 +4,12 @@
# include "config.h"
#endif
+#if 0 // guard invalid preprocessor symbol below
+ // establish a dependency on RUNTIME_IN_STD.cpp
+# ifndef _RWSTD_NO_RUNTIME_IN_STD
+# endif // _RWSTD_NO_RUNTIME_IN_STD
+#endif // 0
+
#define TEST_WHAT
#define bad_alloc exception
#define main test_exception_what
Index: TLS.cpp
===================================================================
--- TLS.cpp (revision 449640)
+++ TLS.cpp (working copy)
@@ -1,12 +1,18 @@
// checking for thread-local storage
-__thread int tls_i;
+#ifdef _MSC_VER
+#define _RWSTD_THREAD __declspec (thread)
+#else
+#define _RWSTD_THREAD __thread
+#endif
-static __thread char tls_static_array [256];
-extern __thread char tls_extern_array [256];
+_RWSTD_THREAD int tls_i;
-__thread char tls_extern_array [256];
+static _RWSTD_THREAD char tls_static_array [256];
+extern _RWSTD_THREAD char tls_extern_array [256];
+_RWSTD_THREAD char tls_extern_array [256];
+
int main ()
{
return tls_i + tls_static_array [0] + tls_extern_array [0];