office-gobmx/liblangtag/liblangtag-0.4.0-windows2.patch

122 lines
3.1 KiB
Diff
Raw Normal View History

--- misc/liblangtag-0.4.0/data/reg2xml.c 2012-11-06 19:22:52.734375000 +0000
+++ misc/build/liblangtag-0.4.0/data/reg2xml.c 2012-11-06 19:12:34.765625000 +0000
@@ -19,6 +19,31 @@
#include "lt-messages.h"
#include "lt-utils.h"
+#ifdef _WIN32
+static char *
+strndup(const char *string,size_t s)
+{
+ const char *p;
+ char *r;
+ if (!string)
+ return NULL;
+ p = string;
+ while (s) {
+ if (!*p)
+ break;
+ p++;
+ s--;
+ }
+ s = (p - string);
+ r = malloc(1+s);
+ if (r) {
+ strncpy(r,string,s);
+ r[s] = 0;
+ }
+ return r;
+}
+#endif
+
/*< private >*/
static char *
_drop_crlf(char *string)
--- misc/liblangtag-0.4.0/extensions/lt-ext-ldml-u.c 2012-10-16 08:25:15.000000000 +0100
+++ misc/build/liblangtag-0.4.0/extensions/lt-ext-ldml-u.c 2012-11-06 19:02:45.328125000 +0000
@@ -14,7 +14,11 @@
#include "config.h"
#endif
+#ifndef _WIN32
#include <stdint.h>
+#else
+typedef unsigned __int64 uint64_t;
+#endif
#include <string.h>
#include <libxml/xpath.h>
#include "lt-error.h"
@@ -136,7 +140,11 @@
if (!strchr(hexdigit, subtag[j]))
goto bail2;
}
+#ifdef _WIN32
+ x = _strtoui64(subtag, &p, 16);
+#else
x = strtoull(subtag, &p, 16);
+#endif
if (p && p[0] == 0 && x <= 0x10ffff) {
retval = TRUE;
xmlFree(name);
--- misc/liblangtag-0.4.0/liblangtag-gobject.pc 2012-10-22 04:47:28.000000000 +0100
+++ misc/build/liblangtag-0.4.0/liblangtag-gobject.pc 2012-11-06 18:42:59.625000000 +0000
@@ -1,6 +1,6 @@
-prefix=/usr
+prefix=/install-liblangtag
exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=/install-liblangtag/lib
includedir=${prefix}/include
Name: liblangtag-gobject
--- misc/liblangtag-0.4.0/liblangtag.pc 2012-10-22 04:47:28.000000000 +0100
+++ misc/build/liblangtag-0.4.0/liblangtag.pc 2012-11-06 18:42:59.171875000 +0000
@@ -1,6 +1,6 @@
-prefix=/usr
+prefix=/install-liblangtag
exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=/install-liblangtag/lib
includedir=${prefix}/include
Name: liblangtag
--- misc/liblangtag-0.4.0/liblangtag/lt-messages.c 2012-11-06 19:22:52.703125000 +0000
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-messages.c 2012-11-06 19:20:22.671875000 +0000
@@ -83,13 +83,21 @@
clen = strlen(cs);
if (clen > 0) {
catstring = malloc(sizeof (char) * (clen + 6));
+#ifdef _WIN32
+ _snprintf(catstring, clen + 6, "[%s]: ", cs);
+#else
snprintf(catstring, clen + 6, "[%s]: ", cs);
+#endif
clen = strlen(catstring);
}
len = tlen + clen + 1;
retval = malloc(sizeof (char) * len);
if (retval) {
- snprintf(retval, len, "%s%s ", ts, catstring ? catstring : "");
+#ifdef _WIN32
+ _snprintf(retval, len, "%s%s ", ts, catstring ? catstring : "");
+#else
+ snprintf(retval, len, "%s%s ", ts, catstring ? catstring : "");
+#endif
}
if (catstring)
free(catstring);
--- misc/liblangtag-0.4.0/liblangtag/lt-utils.c 2012-10-03 07:05:59.000000000 +0100
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-utils.c 2012-11-06 19:16:07.640625000 +0000
@@ -126,7 +126,11 @@
lt_return_val_if_fail (format != NULL, NULL);
+#ifdef _WIN32
+ ap = args;
+#else
va_copy(ap, args);
+#endif
size = vsnprintf(&c, 1, format, ap) + 1;