r18797 - gnucash/trunk - Win32: Add more header includes where necessary to avoid using undeclared functions.
Christian Stimming
cstim at code.gnucash.org
Wed Mar 3 15:45:58 EST 2010
Author: cstim
Date: 2010-03-03 15:45:58 -0500 (Wed, 03 Mar 2010)
New Revision: 18797
Trac: http://svn.gnucash.org/trac/changeset/18797
Modified:
gnucash/trunk/lib/libc/strptime.c
gnucash/trunk/src/backend/xml/gnc-backend-xml.c
gnucash/trunk/src/backend/xml/io-gncxml-v2.c
gnucash/trunk/src/libqof/qof/qof-win32.c
Log:
Win32: Add more header includes where necessary to avoid using undeclared functions.
Modified: gnucash/trunk/lib/libc/strptime.c
===================================================================
--- gnucash/trunk/lib/libc/strptime.c 2010-03-03 20:45:37 UTC (rev 18796)
+++ gnucash/trunk/lib/libc/strptime.c 2010-03-03 20:45:58 UTC (rev 18797)
@@ -48,6 +48,8 @@
#define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
#include <windows.h>
+#include <stdlib.h>
+#include <malloc.h>
#ifdef _MSC_VER
/* In MSVC, the strncasecmp function is available as _strnicmp */
Modified: gnucash/trunk/src/backend/xml/gnc-backend-xml.c
===================================================================
--- gnucash/trunk/src/backend/xml/gnc-backend-xml.c 2010-03-03 20:45:37 UTC (rev 18796)
+++ gnucash/trunk/src/backend/xml/gnc-backend-xml.c 2010-03-03 20:45:58 UTC (rev 18797)
@@ -52,6 +52,13 @@
# include <dirent.h>
#endif
#include <time.h>
+#ifdef G_OS_WIN32
+# include <io.h>
+# define close _close
+# define mktemp _mktemp
+# define read _read
+# define write _write
+#endif
#include "qof.h"
#include "TransLog.h"
Modified: gnucash/trunk/src/backend/xml/io-gncxml-v2.c
===================================================================
--- gnucash/trunk/src/backend/xml/io-gncxml-v2.c 2010-03-03 20:45:37 UTC (rev 18796)
+++ gnucash/trunk/src/backend/xml/io-gncxml-v2.c 2010-03-03 20:45:58 UTC (rev 18797)
@@ -48,6 +48,12 @@
#include "sixtp-utils.h"
#include "gnc-xml.h"
#include "io-utils.h"
+#ifdef G_OS_WIN32
+# include <io.h>
+# define close _close
+# define fdopen _fdopen
+# define read _read
+#endif
/* Do not treat -Wstrict-aliasing warnings as errors because of problems of the
* G_LOCK* macros as declared by glib. See
Modified: gnucash/trunk/src/libqof/qof/qof-win32.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qof-win32.c 2010-03-03 20:45:37 UTC (rev 18796)
+++ gnucash/trunk/src/libqof/qof/qof-win32.c 2010-03-03 20:45:58 UTC (rev 18797)
@@ -26,6 +26,7 @@
#include "gnc-date-p.h"
#include "strptime.h"
#include <windows.h>
+#include <stdlib.h>
static GHashTable *picture_to_format = NULL;
G_LOCK_DEFINE_STATIC(picture_to_format);
More information about the gnucash-changes
mailing list