1 Fix build with glibc 2.26:
3 https://github.com/tpaviot/oce/issues/675
5 Patch copied from upstream source repository:
7 https://github.com/tpaviot/oce/commit/aa1321e68cc004e3debe38d79ae74581a617c767
9 From aa1321e68cc004e3debe38d79ae74581a617c767 Mon Sep 17 00:00:00 2001
10 From: Janus Weil <janus@gcc.gnu.org>
11 Date: Mon, 18 Dec 2017 11:27:55 +0100
12 Subject: [PATCH] fix build errors with glibc 2.26+ due to missing xlocale.h
15 * check for the presence of xlocale.h via cmake
16 * remove related logic from Standard_CLocaleSentry.hxx
19 src/Standard/Standard_CLocaleSentry.hxx | 15 ---------------
20 2 files changed, 1 insertion(+), 15 deletions(-)
22 diff --git a/CMakeLists.txt b/CMakeLists.txt
23 index b782b4101..50e9500b2 100644
26 @@ -616,6 +616,7 @@ if (NOT WIN32)
27 # compilation anywhere in OCE
28 include(CheckIncludeFile)
29 check_include_file(strings.h HAVE_STRINGS_H)
30 + check_include_file(xlocale.h HAVE_XLOCALE_H)
31 include(CheckIncludeFileCXX)
32 check_include_file_cxx(mm_malloc.h HAVE_MM_MALLOC_H)
33 check_include_file_cxx(atomic.h OCE_HAVE_ATOMIC_H)
34 diff --git a/src/Standard/Standard_CLocaleSentry.hxx b/src/Standard/Standard_CLocaleSentry.hxx
35 index 2b226e7f3..1a4c1dadc 100644
36 --- a/src/Standard/Standard_CLocaleSentry.hxx
37 +++ b/src/Standard/Standard_CLocaleSentry.hxx
42 -#ifndef HAVE_XLOCALE_H
43 - //! "xlocale.h" available in Mac OS X and glibc (Linux) for a long time as an extension
44 - //! and become part of POSIX since '2008.
45 - //! Notice that this is impossible to test (_POSIX_C_SOURCE >= 200809L)
46 - //! since POSIX didn't declared such identifier.
47 - #if defined(__APPLE__)
48 - #define HAVE_XLOCALE_H
51 - //! We check _GNU_SOURCE for glibc extensions here and it is always defined by g++ compiler.
52 - #if defined(_GNU_SOURCE) && !defined(__ANDROID__)
53 - #define HAVE_XLOCALE_H
55 -#endif // ifndef HAVE_LOCALE_H