diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index 51998324c89..645b6cd5a56 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -93,7 +94,7 @@ protected: */ inline static const Direction_3& pos_pole() { - static const Direction_3 d(0, 0, 1); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Direction_3, d, 0, 0, 1); return d; } @@ -135,11 +136,11 @@ protected: inline static const Direction_3& identification_normal() { #if (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_1_Y_0) - static const Direction_3 d(0, 1, 0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Direction_3, d, 0, 1, 0); #elif (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_8_Y_6) - static const Direction_3 d(6, 8, 0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Direction_3, d, 6, 8, 0); #elif (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_11_Y_7) - static const Direction_3 d(7, 11, 0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Direction_3, d,7, 11, 0); #else #error CGAL_IDENTIFICATION_XY is not defined #endif @@ -151,7 +152,7 @@ protected: */ inline static const Direction_2& neg_x_2() { - static const Direction_2 d(-1, 0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, -1, 0); return d; } @@ -160,7 +161,7 @@ protected: */ inline static const Direction_2& neg_y_2() { - static const Direction_2 d(0, -1); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, 0, -1); return d; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h index 2ebdaf1a3b5..77e7b6c5f0c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h @@ -26,6 +26,7 @@ #include +#include #include #include @@ -349,15 +350,15 @@ public: private: static Self& get_default_instance() { - static Algebraic_kernel_d_1 kernel; - static typename Rational_function::Polynomial_1 numer(0); - static typename Rational_function::Polynomial_1 denom(1); - static Rational_function rational_function(numer, denom, &kernel); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Algebraic_kernel_d_1, kernel); + typedef typename Rational_function::Polynomial_1 Poly; + CGAL_STATIC_THREAD_LOCAL_VARIABLE(Poly, numer,0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE(Poly, denom, 1); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Rational_function, rational_function, numer, denom, &kernel); - static Algebraic_real_1 x_coordinate = - kernel.construct_algebraic_real_1_object()(Rational(0)); + CGAL_STATIC_THREAD_LOCAL_VARIABLE(Algebraic_real_1, x_coordinate,kernel.construct_algebraic_real_1_object()(Rational(0))); - static Self default_instance(rational_function,x_coordinate); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Self, default_instance, rational_function, x_coordinate); return default_instance; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h index 8f3c49a2512..21fd6aa7040 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h @@ -25,6 +25,7 @@ #include +#include #include #include namespace CGAL { @@ -213,8 +214,8 @@ public: private: static Self& get_default_instance() { - static Algebraic_kernel_d_1 kernel; - static Self x = Self(Polynomial_1(0), Polynomial_1(1), &kernel); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Algebraic_kernel_d_1, kernel); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Self, x, Polynomial_1(0), Polynomial_1(1), &kernel); return x; } public: diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h index 8b3170e6671..a48e518c08c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h @@ -67,12 +67,14 @@ #define STILL_ALIVE std::cout << __LINE__ << "\n"; #include +#include #include #include #include #include + namespace CGAL { template @@ -98,7 +100,7 @@ public: Interval_double > Curve_renderer; static Curve_renderer& instance() { - static Curve_renderer _this; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Curve_renderer, _this); return _this; } @@ -177,20 +179,20 @@ public: #ifdef CGAL_CKVA_USE_STATIC_RENDERER static Default_renderer_2& renderer() { - static Default_renderer_2 rend; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Default_renderer_2, rend); return rend; } #ifdef CGAL_CKVA_USE_MULTIPREC_ARITHMETIC static Bigfloat_renderer_2& bigfloat_renderer() { - static Bigfloat_renderer_2 rend; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Bigfloat_renderer_2, rend); return rend; } #endif #ifdef CGAL_CKVA_USE_RATIONAL_ARITHMETIC static Exact_renderer_2& exact_renderer() { - static Exact_renderer_2 rend; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Exact_renderer_2, rend); return rend; } #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h index 90bfb3715af..354d0928780 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h @@ -31,6 +31,7 @@ #include +#include #include #include #include @@ -185,8 +186,8 @@ public: static NewCKvA& set_instance( const NewCKvA& ckva ) { - static NewCKvA instance; - static NewCKvA binstance; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, instance); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, binstance); if (&ckva == &_reset_instance()) { instance = binstance; @@ -210,7 +211,7 @@ private: * sets instance to default for internal purposes */ static NewCKvA& _set_instance() { - static NewCKvA instance; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, instance); return instance; } @@ -219,7 +220,7 @@ private: * sets instance to default for internal purposes */ static NewCKvA& _reset_instance() { - static NewCKvA instance; + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(NewCKvA, instance); return instance; }