]> git.lyx.org Git - lyx.git/blob - development/Win32/aspell/win32-aspell-0.60.patch
Scons: libintl also needs /MD option
[lyx.git] / development / Win32 / aspell / win32-aspell-0.60.patch
1 Index: common/config.cpp
2 ===================================================================
3 RCS file: /sources/aspell/aspell/common/config.cpp,v
4 retrieving revision 1.72.2.1
5 diff -u -B -b -r1.72.2.1 config.cpp
6 --- common/config.cpp   22 Jun 2005 05:32:29 -0000      1.72.2.1
7 +++ common/config.cpp   18 Sep 2006 17:42:40 -0000
8 @@ -1521,3 +1521,61 @@
9    }
10    
11  }
12 +
13 +
14 +
15 +
16 +#ifdef WIN32PORT
17 +
18 +#include "string.hpp"
19 +
20 +
21 +namespace acommon {
22 +
23 +  String ReadRegString(HKEY hive, String key, String name)
24 +  {
25 +  
26 +    // Reads a string from the Windows registry (used to get paths)  
27 +       
28 +    HKEY hKey;
29 +    unsigned long lType;
30 +    DWORD dwSize;
31 +    unsigned char* szValue = NULL;
32 +       
33 +    if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
34 +    {
35 +      if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)
36 +      {
37 +        szValue = new unsigned char[dwSize + 1];
38 +        ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);
39 +        String RegistryReturn((char*)szValue);
40 +        delete[] szValue;
41 +        return RegistryReturn;
42 +         } else {
43 +           return "";
44 +      }
45 +    } else {
46 +         return "";
47 +       }
48 +  
49 +  }
50 +  
51 +  HKEY GetRegHive()
52 +  {
53 +    
54 +    // Check whether Aspell is installed for the current user or for all users
55 +       
56 +    String value;
57 +       
58 +    if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")
59 +    {
60 +      return HKEY_CURRENT_USER;
61 +    } else {
62 +      return HKEY_LOCAL_MACHINE;
63 +    }
64 +       
65 +  }
66 +
67 +}  
68 +
69 +#endif //WIN32PORT
70 Index: common/config.hpp
71 ===================================================================
72 RCS file: /sources/aspell/aspell/common/config.hpp,v
73 retrieving revision 1.25
74 diff -u -B -b -r1.25 config.hpp
75 --- common/config.hpp   18 Nov 2004 02:01:53 -0000      1.25
76 +++ common/config.hpp   18 Sep 2006 17:42:41 -0000
77 @@ -277,5 +277,20 @@
78  
79  }
80  
81 +#ifdef WIN32PORT
82 +
83 +#include "minwin.h"
84 +
85 +
86 +
87 +namespace acommon {
88 +
89 +  extern HKEY GetRegHive();
90 +  extern String ReadRegString(HKEY type, String key, String name);
91 +
92 +}
93 +
94 +#endif
95 +
96  #endif
97  
98 Index: common/file_util.cpp
99 ===================================================================
100 RCS file: /sources/aspell/aspell/common/file_util.cpp,v
101 retrieving revision 1.10
102 diff -u -B -b -r1.10 file_util.cpp
103 --- common/file_util.cpp        15 Nov 2004 12:29:53 -0000      1.10
104 +++ common/file_util.cpp        18 Sep 2006 17:42:41 -0000
105 @@ -30,6 +30,8 @@
106  #  define ACCESS _access
107  #  include <windows.h>
108  #  include <winbase.h>
109 +#  include <dirent.h>
110 +#  include <asc_ctype.hpp>
111  
112  #else
113  
114 Index: common/gettext_init.cpp
115 ===================================================================
116 RCS file: /sources/aspell/aspell/common/gettext_init.cpp,v
117 retrieving revision 1.4
118 diff -u -B -b -r1.4 gettext_init.cpp
119 --- common/gettext_init.cpp     9 Nov 2004 08:20:24 -0000       1.4
120 +++ common/gettext_init.cpp     18 Sep 2006 17:42:41 -0000
121 @@ -16,7 +16,20 @@
122      if (did_init) return;
123      did_init = true;
124    }
125 +#ifdef WIN32PORT
126 +  // Registry key for Locale Path
127 +  
128 +  aspell::String value;
129 +  HKEY hive;
130 +  
131 +  hive = acommon::GetRegHive();
132 +  value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");
133 +  if (value == "") value = LOCALEDIR;
134
135 +  bindtextdomain("aspell", value.c_str());
136 +#else
137    bindtextdomain("aspell", LOCALEDIR);
138 +#endif
139  }
140  
141  #else
142 Index: common/info.cpp
143 ===================================================================
144 RCS file: /sources/aspell/aspell/common/info.cpp,v
145 retrieving revision 1.34
146 diff -u -B -b -r1.34 info.cpp
147 --- common/info.cpp     10 Nov 2004 06:18:45 -0000      1.34
148 +++ common/info.cpp     18 Sep 2006 17:42:42 -0000
149 @@ -493,7 +493,17 @@
150                       StringList & lst)
151    {
152      lst.clear();
153 -    lst.add(config->retrieve("data-dir"));
154 +       String dictpath;
155 +
156 +#ifdef WIN32PORT
157 +       HKEY hive = acommon::GetRegHive();
158 +    // Registry key for dictionary path
159 +       dictpath =acommon::ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;
160 +    if (dictpath == "") dictpath = config->retrieve("data-dir");
161 +#else
162 +    dictpath = config->retrieve("data-dir");
163 +#endif
164 +       lst.add(dictpath);
165      lst.add(config->retrieve("dict-dir"));
166    }
167  
168 Index: common/objstack.cpp
169 ===================================================================
170 RCS file: /sources/aspell/aspell/common/objstack.cpp,v
171 retrieving revision 1.5
172 diff -u -B -b -r1.5 objstack.cpp
173 --- common/objstack.cpp 29 Jun 2004 00:18:16 -0000      1.5
174 +++ common/objstack.cpp 18 Sep 2006 17:42:42 -0000
175 @@ -1,6 +1,7 @@
176  
177  #include "objstack.hpp"
178  
179 +namespace std {}
180  namespace acommon {
181  
182  using namespace std;
183 Index: common/posib_err.cpp
184 ===================================================================
185 RCS file: /sources/aspell/aspell/common/posib_err.cpp,v
186 retrieving revision 1.16
187 diff -u -B -b -r1.16 posib_err.cpp
188 --- common/posib_err.cpp        21 Nov 2004 02:52:22 -0000      1.16
189 +++ common/posib_err.cpp        18 Sep 2006 17:42:42 -0000
190 @@ -4,6 +4,7 @@
191  // license along with this library if you did not you can find
192  // it at http://www.gnu.org/.
193  
194 +#include <settings.h>
195  #include <stdlib.h>
196  #include <stdio.h>
197  #include <assert.h>
198 Index: common/vector.hpp
199 ===================================================================
200 RCS file: /sources/aspell/aspell/common/vector.hpp,v
201 retrieving revision 1.12
202 diff -u -B -b -r1.12 vector.hpp
203 --- common/vector.hpp   21 Jun 2004 02:40:07 -0000      1.12
204 +++ common/vector.hpp   18 Sep 2006 17:42:42 -0000
205 @@ -36,13 +36,13 @@
206      }
207      T * data() {return &*this->begin();}
208      T * data(int pos) {return &*this->begin() + pos;}
209 -    T * data_end() {return &*this->end();}
210 +    T * data_end() {return &this->back()+1;}
211  
212      T * pbegin() {return &*this->begin();}
213 -    T * pend()   {return &*this->end();}
214 +    T * pend()   {return &this->back()+1;}
215  
216      const T * pbegin() const {return &*this->begin();}
217 -    const T * pend()   const {return &*this->end();}
218 +    const T * pend()   const {return &this->back()+1;}
219  
220      template <typename U>
221      U * datap() { 
222 Index: modules/speller/default/affix.hpp
223 ===================================================================
224 RCS file: /sources/aspell/aspell/modules/speller/default/affix.hpp,v
225 retrieving revision 1.19
226 diff -u -B -b -r1.19 affix.hpp
227 --- modules/speller/default/affix.hpp   29 Nov 2004 17:50:06 -0000      1.19
228 +++ modules/speller/default/affix.hpp   18 Sep 2006 17:42:42 -0000
229 @@ -109,7 +109,7 @@
230      }
231      WordAff * expand_suffix(ParmString word, const unsigned char * new_aff,
232                              ObjStack &, int limit = INT_MAX,
233 -                            unsigned char * new_aff = 0, WordAff * * * l = 0,
234 +                            unsigned char * new_aff2 = 0, WordAff * * * l = 0,
235                              ParmString orig_word = 0) const;
236      
237    private:
238 Index: win32/settings.h
239 ===================================================================
240 RCS file: /sources/aspell/aspell/win32/settings.h,v
241 retrieving revision 1.2
242 diff -u -B -b -r1.2 settings.h
243 --- win32/settings.h    3 Jan 2004 12:06:25 -0000       1.2
244 +++ win32/settings.h    18 Sep 2006 17:42:43 -0000
245 @@ -1,44 +1,43 @@
246 -/* common/settings.h.  Generated by configure.  */
247  /* common/settings.h.in.  Generated from configure.ac by autoheader.  */
248  
249  /* Defined if no special Workarounds are needed for Curses headers */
250 -/* #undef CURSES_INCLUDE_STANDARD */
251 +#undef CURSES_INCLUDE_STANDARD
252  
253  /* Defined if special Wordaround I is need for Curses headers */
254 -/* #undef CURSES_INCLUDE_WORKAROUND_1 */
255 +#undef CURSES_INCLUDE_WORKAROUND_1
256  
257  /* Defined if curses like POSIX Functions should be used */
258 -/* #undef CURSES_ONLY */
259 +#undef CURSES_ONLY
260  
261  /* Defined if win32 relocation should be used */
262 -/* #undef ENABLE_WIN32_RELOCATABLE */
263 +#define ENABLE_WIN32_RELOCATABLE 1
264  
265  /* Define to 1 if you have the <dlfcn.h> header file. */
266 -/* #undef HAVE_DLFCN_H */
267 +#undef HAVE_DLFCN_H
268  
269  /* Defined if msdos getch is supported */
270 -/* #undef HAVE_GETCH */
271 +#undef HAVE_GETCH
272  
273  /* Define to 1 if you have the <inttypes.h> header file. */
274 -#define HAVE_INTTYPES_H 1
275 +#undef HAVE_INTTYPES_H
276  
277  /* Defined if the curses library is available */
278 -/* #undef HAVE_LIBCURSES */
279 +#undef HAVE_LIBCURSES
280  
281  /* Define to 1 if you have the <memory.h> header file. */
282  #define HAVE_MEMORY_H 1
283  
284  /* Defined if mmap and friends is supported */
285 -/* #undef HAVE_MMAP */
286 +#undef HAVE_MMAP
287  
288  /* Define to 1 if you have the <stdint.h> header file. */
289 -#define HAVE_STDINT_H 1
290 +#undef HAVE_STDINT_H
291  
292  /* Define to 1 if you have the <stdlib.h> header file. */
293  #define HAVE_STDLIB_H 1
294  
295  /* Define to 1 if you have the <strings.h> header file. */
296 -#define HAVE_STRINGS_H 1
297 +#undef HAVE_STRINGS_H
298  
299  /* Define to 1 if you have the <string.h> header file. */
300  #define HAVE_STRING_H 1
301 @@ -50,43 +49,73 @@
302  #define HAVE_SYS_TYPES_H 1
303  
304  /* Define to 1 if you have the <unistd.h> header file. */
305 -#define HAVE_UNISTD_H 1
306 +#undef HAVE_UNISTD_H
307  
308  /* Name of package */
309 -#define PACKAGE "aspell"
310 +#undef PACKAGE
311  
312  /* Define to the address where bug reports for this package should be sent. */
313 -#define PACKAGE_BUGREPORT ""
314 +#undef PACKAGE_BUGREPORT
315  
316  /* Define to the full name of this package. */
317 -#define PACKAGE_NAME ""
318 +#undef PACKAGE_NAME
319  
320  /* Define to the full name and version of this package. */
321 -#define PACKAGE_STRING ""
322 +#undef PACKAGE_STRING
323  
324  /* Define to the one symbol short name of this package. */
325 -#define PACKAGE_TARNAME ""
326 +#undef PACKAGE_TARNAME
327  
328  /* Define to the version of this package. */
329 -#define PACKAGE_VERSION ""
330 +#undef PACKAGE_VERSION
331  
332  /* Defined if Posix Termios is Supported */
333 -/* #undef POSIX_TERMIOS */
334 +#undef POSIX_TERMIOS
335  
336  /* Defined if STL rel_ops polute the global namespace */
337 -/* #undef REL_OPS_POLLUTION */
338 +#undef REL_OPS_POLLUTION
339  
340  /* Define to 1 if you have the ANSI C header files. */
341 -#define STDC_HEADERS 1
342 +#undef STDC_HEADERS
343  
344  /* Defined if file ino is supported */
345 -/* #undef USE_FILE_INO */
346 +#undef USE_FILE_INO
347  
348  /* Defined if file locking and truncating is supported */
349 -/* #undef USE_FILE_LOCKS */
350 +#undef USE_FILE_LOCKS
351  
352  /* Defined if Posix locales are supported */
353 -/* #undef USE_LOCALE */
354 +#undef USE_LOCALE
355  
356  /* Version number of package */
357 -#define VERSION "0.50.3"
358 +#define VERSION "0.50.4.1"
359 +
360 +#define PACKAGE_VERSION "aspell-6.0"
361 +
362 +#define C_EXPORT extern "C"
363 +
364 +#if defined(ASPELL_NO_EXPORTS)
365 +#  define ASPELL_API
366 +#elif defined(_WINDLL) || defined(_USRDLL) || defined(__DLL__)
367 +#  define ASPELL_API  __declspec(dllexport)
368 +#else
369 +#  define ASPELL_API  __declspec(dllimport)
370 +#endif /*_DLL */
371 +
372 +// Microsoft VC6.0 does not allow typename except when directly
373 +// declaring a template param.  The other supporte compilers (Borlands
374 +// BCB5.5 and GNU C++) require or allow it anywhere in the template
375 +// decl. The macro TYPENAME is defines to whatever works.
376 +#if defined(_MSC_VER) && (_MSC_VER<1300)
377 +#define TYPENAME
378 +#else
379 +#define TYPENAME typename
380 +#endif
381 +
382 +// Microsoft Visual C 6.0 stdio.h does not declare snprintf, rather
383 +// it declares _snprintf. We define snprintf for VC builds here.
384 +// snprintf is not standard, but it is common.
385 +#ifdef _MSC_VER
386 +#define snprintf _snprintf
387 +#define vsnprintf _vsnprintf
388 +#endif