gnucash-on-windows master: Ofx patch - version 3

Geert Janssens gjanssens at code.gnucash.org
Sat Apr 28 10:03:19 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash-on-windows/commit/2ab10831 (commit)
	from  https://github.com/Gnucash/gnucash-on-windows/commit/b606f4f6 (commit)



commit 2ab108315df200724ae2a2240ce1bd8de0a256cd
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Apr 28 15:06:53 2018 +0200

    Ofx patch - version 3
    
    The previous version still had build issues because it needed
    a few extra OS_WIN32 instances replaced with __WIN32__.
    I have chosen to replace all of them. And this time I tested locally
    before commit. I believe this one finally works.

diff --git a/patches/libofx-tempfile.patch b/patches/libofx-tempfile.patch
index e037fe6..1ba632a 100644
--- a/patches/libofx-tempfile.patch
+++ b/patches/libofx-tempfile.patch
@@ -1,8 +1,24 @@
---- a/lib/ofx_preproc.cpp	2013-04-17 20:09:11 +0000
-+++ b/lib/ofx_preproc.cpp	2013-10-14 09:00:31 +0000
-@@ -109,11 +109,15 @@ int ofx_proc_file(LibofxContextPtr ctx, const char * p_filename)
-     }
+diff --git a/lib/ofx_preproc.cpp b/lib/ofx_preproc.cpp
+index 68a4170..c5fc7ee 100644
+--- a/lib/ofx_preproc.cpp
++++ b/lib/ofx_preproc.cpp
+@@ -34,13 +34,13 @@
+ #include <iconv.h>
+ #endif
+ 
+-#ifdef OS_WIN32
++#ifdef __WIN32__
+ # define DIRSEP "\\"
+ #else
+ # define DIRSEP "/"
+ #endif
  
+-#ifdef OS_WIN32
++#ifdef __WIN32__
+ # include "win32.hh"
+ # include <windows.h> // for GetModuleFileName()
+ # undef ERROR
+@@ -111,7 +111,11 @@ int ofx_proc_file(LibofxContextPtr ctx, const char * p_filename)
      mkTempFileName("libofxtmpXXXXXX", tmp_filename, sizeof(tmp_filename));
  
      message_out(DEBUG, "ofx_proc_file(): Creating temp file: " + string(tmp_filename));
@@ -14,11 +30,7 @@
      if (tmp_file_fd)
      {
        tmp_file.open(tmp_filename);
-       if (!tmp_file)
-       {
-@@ -308,11 +312,11 @@ int ofx_proc_file(LibofxContextPtr ctx, const char * p_filename)
- #ifdef HAVE_ICONV
-             size_t inbytesleft = strlen(s_buffer.c_str());
+@@ -310,7 +314,7 @@ int ofx_proc_file(LibofxContextPtr ctx, const char * p_filename)
              size_t outbytesleft = inbytesleft * 2 - 1;
              iconv_buffer = (char*) malloc (inbytesleft * 2);
              memset(iconv_buffer, 0, inbytesleft * 2);
@@ -27,11 +39,51 @@
              const char * inchar = (const char *)s_buffer.c_str();
  #else
              char * inchar = (char *)s_buffer.c_str();
- #endif
-             char * outchar = iconv_buffer;
---- a/lib/win32.cpp	Wed Mar 30 15:30:50 2011
-+++ b/lib/win32.cpp	Sun Mar 29 15:07:27 2015
-@@ -25,11 +25,11 @@
+@@ -528,7 +532,7 @@ string sanitize_proprietary_tags(string input_string)
+ }
+ 
+ 
+-#ifdef OS_WIN32
++#ifdef __WIN32__
+ static std::string get_dtd_installation_directory()
+ {
+   // Partial implementation of
+@@ -583,7 +587,7 @@ std::string find_dtd(LibofxContextPtr ctx, const std::string& dtd_filename)
+     }
+   }
+ 
+-#ifdef OS_WIN32
++#ifdef __WIN32__
+   dtd_path_filename = get_dtd_installation_directory();
+   if (!dtd_path_filename.empty())
+   {
+diff --git a/lib/ofx_utilities.cpp b/lib/ofx_utilities.cpp
+index 602c866..8ef4668 100644
+--- a/lib/ofx_utilities.cpp
++++ b/lib/ofx_utilities.cpp
+@@ -28,7 +28,7 @@
+ #include "messages.hh"
+ #include "ofx_utilities.hh"
+ 
+-#ifdef OS_WIN32
++#ifdef __WIN32__
+ # define DIRSEP "\\"
+ #else
+ # define DIRSEP "/"
+@@ -273,7 +273,7 @@ std::string get_tmp_dir()
+   if (var) return var;
+   var = getenv("TEMP");
+   if (var) return var;
+-#ifdef OS_WIN32
++#ifdef __WIN32__
+   return "C:\\";
+ #else
+   return "/tmp";
+diff --git a/lib/win32.cpp b/lib/win32.cpp
+index 69078f2..5f863de 100644
+--- a/lib/win32.cpp
++++ b/lib/win32.cpp
+@@ -25,9 +25,9 @@
  
  
  
@@ -43,11 +95,11 @@
  {
    int fd = -1;
    int len;
-   char *nf;
-   int i;
---- a/lib/win32.hh	Wed Mar 30 15:30:50 2011
-+++ b/lib/win32.hh	Sun Mar 29 16:26:58 2015
-@@ -21,11 +21,11 @@
+diff --git a/lib/win32.hh b/lib/win32.hh
+index 353093a..8df3970 100644
+--- a/lib/win32.hh
++++ b/lib/win32.hh
+@@ -21,9 +21,9 @@
  #endif
  
  
@@ -59,4 +111,3 @@
  
  
  #endif
- 



Summary of changes:
 patches/libofx-tempfile.patch | 91 +++++++++++++++++++++++++++++++++----------
 1 file changed, 71 insertions(+), 20 deletions(-)



More information about the gnucash-changes mailing list