summaryrefslogtreecommitdiff
path: root/misc/openoffice/patches/patch-bj
blob: 33ac92a60a0059b3baa8d058cac28c7378fc4289 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
$NetBSD: patch-bj,v 1.1.1.1 2002/02/13 18:09:22 mrauch Exp $

--- ../sal/osl/unx/nlsupport.c.orig	Mon Nov 12 21:21:31 2001
+++ ../sal/osl/unx/nlsupport.c
@@ -63,7 +63,7 @@
 #include <osl/diagnose.h>
 #include <osl/process.h>
 
-#if defined(LINUX) || defined(SOLARIS)
+#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD)
 #include <pthread.h>
 #include <locale.h>
 #include <langinfo.h>
@@ -242,7 +242,7 @@
     return NULL;
 }
         
-#if defined(LINUX) || defined(SOLARIS)
+#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD)
 
 /*
  * This implementation of osl_getTextEncodingFromLocale maps 
@@ -296,7 +296,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 */
@@ -477,7 +477,7 @@
     { "WIN-SAMI-2",                 RTL_TEXTENCODING_DONTKNOW }     /* WS2 */
 };
 
-#endif /* ifdef LINUX */
+#endif /* ifdef LINUX || NETBSD */
 
 static pthread_mutex_t aLocalMutex = PTHREAD_MUTEX_INITIALIZER;
 
@@ -516,7 +516,11 @@
     }
         
     /* get the charset as indicated by the LC_CTYPE locale */
+#if defined(NETBSD) && !defined(CODESET) 
+    codeset = NULL;
+#else
     codeset = nl_langinfo( CODESET );
+#endif
 
     if ( codeset != NULL )
     {
@@ -595,7 +599,7 @@
     return ret;
 }
 
-#elif defined(MACOSX) /* ifdef LINUX || SOLARIS */
+#elif defined(MACOSX) /* ifdef LINUX || SOLARIS || NETBSD */
 
 /*
  * FIXME: the MacOS X implemetation is missing
@@ -628,7 +632,7 @@
     return 0;
 }
 
-#else /* ifdef LINUX || SOLARIS || MACOSX */
+#else /* ifdef LINUX || SOLARIS || MACOSX || NETBSD */
 
 /*
  * This implementation of osl_getTextEncodingFromLocale maps 
@@ -829,7 +833,7 @@
             snprintf(env_buf, sizeof(env_buf), "LC_ALL=%s", locale_buf);
             env_buf[sizeof(env_buf)] = '\0';
             putenv(env_buf);
-#elif defined( FREEBSD ) || defined( NETBSD )
+#elif defined( FREEBSD ) 
             setenv( "LC_ALL", locale_buf, 1);
 #else
             setenv( "LC_ALL", locale_buf );
@@ -841,7 +845,7 @@
             snprintf(env_buf, sizeof(env_buf), "LC_CTYPE=%s", locale_buf);
             env_buf[sizeof(env_buf)] = '\0';
             putenv(env_buf);
-#elif defined( FREEBAD ) || defined( NETBSD )
+#elif defined( FREEBAD ) 
             setenv("LC_CTYPE", locale_buf, 1 );
 #else
             setenv( "LC_CTYPE", locale_buf );
@@ -853,7 +857,7 @@
             snprintf(env_buf, sizeof(env_buf), "LANG=%s", locale_buf);
             env_buf[sizeof(env_buf)] = '\0';
             putenv(env_buf);
-#elif defined( FREEBAD ) || defined( NETBSD )
+#elif defined( FREEBAD ) 
             setenv("LC_CTYPE", locale_buf, 1 );
 #else
             setenv( "LANG", locale_buf );
@@ -864,6 +868,6 @@
     return 0;
 }
 
-#endif /* ifdef LINUX || SOLARIS || MACOSX*/
+#endif /* ifdef LINUX || SOLARIS || MACOSX || NETBSD */