info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-mtools] Build failure due to missing locale_t, newlocale, LC_CTYPE


From: Ryan Schmidt
Subject: [Info-mtools] Build failure due to missing locale_t, newlocale, LC_CTYPE_MASK, toupper_l, strncasecmp_l
Date: Mon, 9 Nov 2020 03:16:08 -0600

Hi, I'm a developer with MacPorts. We have mtools 4.0.24 in MacPorts. I was 
trying to update it to 4.0.25 but it does not build on macOS. The errors are:


config.c:182:8: error: unknown type name 'locale_t'
static locale_t C=NULL;
       ^
config.c:186:6: error: implicit declaration of function 'newlocale' is invalid 
in C99 [-Werror,-Wimplicit-function-declaration]
        C = newlocale(LC_CTYPE_MASK, "C", NULL);
            ^
config.c:186:6: note: did you mean 'setlocale'?
/usr/include/locale.h:53:8: note: 'setlocale' declared here
char            *setlocale(int, const char *);
                 ^
config.c:186:16: error: use of undeclared identifier 'LC_CTYPE_MASK'
        C = newlocale(LC_CTYPE_MASK, "C", NULL);
                      ^
config.c:193:15: error: implicit declaration of function 'toupper_l' is invalid 
in C99 [-Werror,-Wimplicit-function-declaration]
    int ret = toupper_l(drive, C);
              ^
config.c:193:15: note: did you mean 'toupper'?
/usr/include/_ctype.h:298:1: note: 'toupper' declared here
toupper(int _c)
^
config.c:205:12: error: implicit declaration of function 'strncasecmp_l' is 
invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return strncasecmp_l(a, b, len, C);
           ^
config.c:205:12: note: did you mean 'strncasecmp'?
/usr/include/strings.h:79:6: note: 'strncasecmp' declared here
int      strncasecmp(const char *, const char *, size_t);
         ^
5 errors generated.


It looks like all 5 of these things are defined in xlocale.h so you should 
#include it. I'm not very familiar with your codebase, but based on how you've 
handled other includes, I guess you might want to write a configure test for 
the presence of the header and then include it in your sysincludes.h if it was 
present. If I add "#include <xlocale.h>" to your sysincludes.h then it builds.

-Ryan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]