Mac OS port
Closed, ResolvedPublic

Description

The port is blocked at the moment by the file parser.y

parser.y:227:3: error: use of undeclared identifier 'locale_t'
                locale_t locale = newlocale (LC_NUMERIC_MASK, "C", NULL);

locale_t is a POSIX-typedef define in GNU C in xlocale.h. parser.y includes locale.h that includes xlocale.h.
xlocale.h is included in locale.h if USE_XOPEN2K8 is defined. Users are not supposed to use the USE_XXX macros, instead one has to use _GNU_SOURCE to enable USE_GNU and _POSIX_C_SOURCE=200809L (or greater) to enable USE_XOPEN2K8.

clang on Mac OS doesn't use the GNU part on default. So, we need to experiment with the flags _GNU_SOURCE and/or _POSIX_C_SOURCE in CMakeLists.txt (set(_GNU_SOURCE true) , etc.).

One comment found on stackoverflow:

When USE_GNU is defined, USE_XOPEN2K8 is always defined as well, unless you are explicitly defining or undefining these macros, which you must not do. Use _GNU_SOURCE, _XOPEN_SOURCE {500,600,700,...} etc. macros before including the first header instead. This is the recommended way to select the GNU feature set in glibc headers, together with defining it on the command line (-D_GNU_SOURCE).

Alternatively, you can try specifying GNU extension usage to gcc through the -std command line switch (gnu89, gnu99, and so forth).

Further information:
http://lists.gnu.org/archive/html/bug-gnulib/2009-11/msg00340.html
http://stackoverflow.com/questions/13879302/purpose-of-use-xopen2k8-and-how-to-set-it

Related Objects

Mentioned In
T3196: MacOS port
Mentioned Here
T3196: MacOS port
asemke created this task.Feb 6 2016, 11:30 AM
asemke updated the task description. (Show Details)Feb 6 2016, 11:33 AM
asemke updated the task description. (Show Details)
sgerlach closed this task as Resolved.
sgerlach claimed this task.
sgerlach added a subscriber: sgerlach.

see T3196

sgerlach moved this task from Backlog to Done on the LabPlot board.Jul 15 2016, 11:28 AM