comparison src/msvc-pstoedit-1.patch @ 3124:824f84572d1e

[MSVC] enable pstoedit compilation
author Michael Goffioul <michael.goffioul@gmail.com>
date Sat, 06 Jul 2013 00:06:12 -0400
parents
children
comparison
equal deleted inserted replaced
3123:38ee52ac978e 3124:824f84572d1e
1 diff -ur pstoedit-3.61-orig/src/dynload.cpp pstoedit-3.61/src/dynload.cpp
2 --- pstoedit-3.61-orig/src/dynload.cpp 2012-08-28 09:52:31 -0400
3 +++ pstoedit-3.61/src/dynload.cpp 2013-07-05 23:48:11 -0400
4 @@ -434,7 +434,7 @@
5 // errstream << "szExePath " << szExePath << endl;
6
7 if ((STRICMP(fullname, szExePath) != 0)
8 - && (STRICMP(finddata.cFileName, "pstoedit.dll") != 0)) {
9 + && (strstr(finddata.cFileName, "pstoedit") == NULL)) {
10 // avoid loading dll itself again
11 // errstream << "loading " << fullname << endl;
12 loadaPlugin(fullname, errstream, verbose);
13 diff -ur pstoedit-3.61-orig/src/miscutil.cpp pstoedit-3.61/src/miscutil.cpp
14 --- pstoedit-3.61-orig/src/miscutil.cpp 2012-08-28 09:52:31 -0400
15 +++ pstoedit-3.61/src/miscutil.cpp 2013-07-05 23:36:21 -0400
16 @@ -26,7 +26,7 @@
17 // #ifdef _MSC_VER
18 // for getcwd ( at least for Visual C++)
19
20 -#if defined(unix) || defined(__unix__) || defined(_unix) || defined(__unix) || defined(__EMX__) || defined (NetBSD) || defined(__APPLE__) || defined(_AIX)
21 +#if defined(unix) || defined(__unix__) || defined(_unix) || defined(__unix) || defined(__EMX__) || defined (NetBSD) || defined(__APPLE__) || defined(_AIX) || defined(_MSC_VER)
22 #include <unistd.h>
23
24 #ifdef __hpux
25 diff -ur pstoedit-3.61-orig/src/pstoedit.cpp pstoedit-3.61/src/pstoedit.cpp
26 --- pstoedit-3.61-orig/src/pstoedit.cpp 2012-08-28 09:52:31 -0400
27 +++ pstoedit-3.61/src/pstoedit.cpp 2013-07-05 23:50:53 -0400
28 @@ -263,7 +263,12 @@
29 if (verbose) errstream << "pstoedit : path to myself:" << progname << " " << r << " " << szExePath<< endl;
30 char *p = 0;
31 if (r && (p = strrchr(szExePath, directoryDelimiter)) != 0) {
32 + int len;
33 *p = '\0';
34 + if ((len = strlen (szExePath)) >= 4 && STRICMP (&szExePath[len-4], "\\bin") == 0) {
35 + strcpy (&szExePath[len-3], "lib");
36 + strncat (szExePath, "\\pstoedit", sizeof (szExePath));
37 + }
38 if (strcmp(szExePath, plugindir.value() ? plugindir.value() : "") != 0) {
39 loadPlugInDrivers(szExePath, errstream,verbose);
40 pluginsloaded = true;