tpaviot / oce

OpenCASCADE Community Edition (OCE): a community driven fork of the Open CASCADE library.
http://groups.google.com/group/oce-dev
GNU Lesser General Public License v2.1
811 stars 284 forks source link

fix build errors with glibc 2.26+ due to missing xlocale.h (issue #675) #684

Closed janusw closed 6 years ago

janusw commented 6 years ago
tpaviot commented 6 years ago

@janusw thank you for your contribution

janusw commented 6 years ago

Thanks for merging! :)

tpaviot commented 6 years ago

@janusw FYI your commit broke master because a failure in osx build. My bad, I should have carefull read the travis log. Anyway, commit 1a575f2e14889fd894d448ed65217a61bcb114df is a fix for osx. Please submit any better solution

janusw commented 6 years ago

Oops, sorry for the breakage. Unfortunately I have no access to an Apple machine right now, so I cannot test on OSX (ditched my MacBook for an XPS13 couple of years ago).

Also I don't quite understand the problem (and the fix). If OSX wants to #include , why is the file not found via cmake? Or is it?

Can you give more detail on how it breaks?

Cheers, Janus

janusw commented 6 years ago

Ok, I guess I found the Travis log (https://travis-ci.org/tpaviot/oce/jobs/318008093), where cmake says:

Looking for xlocale.h - found

and then the actual error is:

/Users/travis/build/tpaviot/oce/src/Standard/Standard_CString.cxx:95:10: error: no matching function for call to 'strtod_l'
  return strtod_l (theStr, theNextPtr, Standard_CLocaleSentry::GetCLocale());
         ^~~~~~~~
[  1%] Building CXX object adm/cmake/TKernel/CMakeFiles/TKernel.dir/__/__/__/src/Standard/Standard_MMgrOpt.cxx.o
/usr/include/xlocale/_stdlib.h:40:9: note: candidate function not viable: cannot convert argument of incomplete type 'clocale_t' (aka 'void *') to 'locale_t' (aka '_xlocale *') for 3rd argument
double   strtod_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtod_l);
         ^
janusw commented 6 years ago

Unfortunately I'm a bit lost here. In particular I don't really understand the behavior on Mac OS, as described in the previous comment:

I guess I must be missing something here, because the above doesn't make much sense to me. I'd appreciate any kind of comments (or testing from someone who has access to a Mac OS machine).

janusw commented 6 years ago

In any case it seems a workaround has been applied in 699869bdd6a9defb431fa4b151477a8f86c4ea57.