More minor MSVC code fixes.

However, this code doesn't compile with MSVC9.0 for a few reasons:

1. libguile.h comes with its own scmconfig.h which contains HAVE_STDINT_H
whereas MSVC doesn't have that. This is stupid guile which doesn't accept
the fact that the user uses a different compiler than how they compiled guile.

2. Some initializations are not supported: Account.c:3312 etc.

3. The C99 "designated initializers" of e.g. Account.c:4661 ff. (r17724,
bug#539957) are not supported by MSVC9.0 - this is the hardest problem
of these all.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18738 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-02-25 17:42:43 +00:00
parent 69dc9107ff
commit 82b8b99c9d
6 changed files with 41 additions and 9 deletions

View File

@ -42,7 +42,16 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#else
# ifdef _MSC_VER
/* MSVC compatibility code */
# include <io.h>
# define write _write
# define ssize_t int
# endif
#endif
#include "gnc-gkeyfile-utils.h"

View File

@ -30,8 +30,12 @@
#include <sys/types.h>
#include <regex.h>
#include <sys/time.h>
#include <unistd.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "gnc-lot.h"
#include "Account.h"

View File

@ -30,9 +30,13 @@
#include <glib/gi18n.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "qof.h"
#include "Split.h"

View File

@ -30,9 +30,20 @@
#include <glib/gi18n.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#else
/* We simply define the struct timeval on our own here. */
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
/* include <Winsock2.h> */
#endif
#include <time.h>
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "AccountP.h"
#include "Scrub.h"

View File

@ -42,7 +42,9 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h>
#include "gnc-engine.h"

View File

@ -10,7 +10,9 @@
#include <string.h>
#include <gmodule.h>
#include <sys/types.h>
#include <dirent.h>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
#endif
#include "gnc-module.h"