Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / gnu / usr.bin / groff / src / libs / libgroff / patches / cset.cpp.patch
1 $DragonFly: src/gnu/usr.bin/groff/src/libs/libgroff/patches/cset.cpp.patch,v 1.2 2005/09/09 14:11:04 asmodai Exp $
2
3 --- cset.cpp    2005-09-09 14:51:59.000000000 +0200
4 +++ cset.cpp    2005-09-09 14:53:15.000000000 +0200
5 @@ -21,6 +21,9 @@
6  #include <ctype.h>
7  
8  #include "lib.h"
9 +#if defined(__DragonFly__) || defined(__FreeBSD__)
10 +#include <locale.h>
11 +#endif
12  #include "cset.h"
13  
14  cset csalpha(CSET_BUILTIN);
15 @@ -35,7 +38,7 @@
16  cset csgraph(CSET_BUILTIN);
17  cset cscntrl(CSET_BUILTIN);
18  
19 -#ifdef isascii
20 +#if defined(isascii) && (!defined(__DragonFly__) || !defined(__FreeBSD__))
21  #define ISASCII(c) isascii(c)
22  #else
23  #define ISASCII(c) (1)
24 @@ -88,6 +91,10 @@
25    if (initialised)
26      return;
27    initialised = 1;
28 +#if defined(__DragonFly__) || defined(__FreeBSD__)
29 +  (void)setlocale(LC_CTYPE, "");
30 +#endif
31 +
32    for (int i = 0; i <= UCHAR_MAX; i++) {
33      csalpha.v[i] = ISASCII(i) && isalpha(i);
34      csupper.v[i] = ISASCII(i) && isupper(i);