summaryrefslogtreecommitdiff
path: root/misc/openoffice/patches/patch-cx
blob: 001d8e0476a9d7a7ff9ca2e088e0a8781003fdb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
$NetBSD: patch-cx,v 1.1.1.1 2002/02/13 18:09:22 mrauch Exp $

--- ../tools/source/string/charset.cxx.orig	Thu May 10 13:35:20 2001
+++ ../tools/source/string/charset.cxx
@@ -64,7 +64,7 @@
 #elif defined( OS2 )
 #define INCL_DOSNLS
 #include <svpm.h>
-#elif defined(LINUX) || defined(SOLARIS)
+#elif defined(LINUX) || defined(SOLARIS) || defined(NETBSD)
 #include <stdio.h>
 #include <stdlib.h>
 #include <strings.h>
@@ -126,7 +126,7 @@
 
 // -----------------------------------------------------------------------
 
-#if defined(NETBSD) || defined(SCO)
+#if defined(SCO)
 
 // check if there is a charset qualifier at the end of the given locale string
 // e.g. de.ISO8859-15 or de.ISO8859-15@euro which strongly indicates what
@@ -323,7 +323,7 @@
     return RTL_TEXTENCODING_DONTKNOW;
 }
 
-#elif defined(LINUX) || defined(SOLARIS)
+#elif defined(LINUX) || defined(SOLARIS) || defined(NETBSD)
 
 typedef struct {
     const char              *key;
@@ -363,7 +363,7 @@
 /* XXX MS-874 is an extension to tis620, so this is not
  * really equivalent */
 
-#elif defined(LINUX)
+#elif defined(LINUX) || defined(NETBSD)
 
 const _pair _nl_language_list[] = {
     { "ANSI_X3.110-1983",   RTL_TEXTENCODING_DONTKNOW },/* ISO-IR-99 NAPLPS */
@@ -541,7 +541,7 @@
 
 };
 
-#endif /* LINUX, SOLARIS */
+#endif /* LINUX, SOLARIS, NETBSD */
 
 static int
 _pair_compare (const char *key, const _pair *pair)
@@ -601,7 +601,11 @@
 
     /* get the charset as indicated by the LC_CTYPE locale */
     char *ctype_locale = setlocale( LC_CTYPE, "" );
+#if defined(NETBSD) && !defined(CODESET)
+    char *codeset      = NULL;
+#else
     char *codeset      = nl_langinfo( CODESET );
+#endif
 
     if ( codeset != NULL )
     {
@@ -707,11 +711,11 @@
 #ifdef UNX
         CharSet nTextEncoding;
 
-#if defined(NETBSD) || defined(SCO)
+#if defined(SCO)
         nTextEncoding = GetSystemCharSetFromEnvironment();
         if (nTextEncoding == RTL_TEXTENCODING_DONTKNOW)
             nTextEncoding = GetSystemCharSetFromSystemLanguage();
-#elif defined(LINUX) || defined(SOLARIS)
+#elif defined(LINUX) || defined(SOLARIS) || defined(NETBSD)
         nTextEncoding = GetSystemCharsetFromNLLanginfo();
 #elif defined(MACOSX)
         nTextEncoding = RTL_TEXTENCODING_DONTKNOW;