MSVC compatiblity: snprintf is required to have a prefixing underscore.

Also, more symbols of libguile/gc.h need explicit declspec on MSVC.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18864 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-03-07 13:06:03 +00:00
parent 9eff25ed38
commit 7cd0515ffb
2 changed files with 6 additions and 2 deletions

View File

@ -397,8 +397,8 @@ EOF
${DLLTOOL} -d $_GUILE_UDIR/lib/libguile.def -D $_GUILE_UDIR/bin/libguile.dll -l $_GUILE_UDIR/lib/libguile.lib
# Also, for MSVC compiler we need to slightly modify the gc.h header
GC_H=$_GUILE_UDIR/include/libguile/gc.h
grep -v 'extern.*_freelist2;' ${GC_H} > ${GC_H}.tmp
mv ${GC_H}.tmp ${GC_H}
grep -v 'extern .*_freelist2;' ${GC_H} > ${GC_H}.tmp
grep -v 'extern int scm_block_gc;' ${GC_H}.tmp > ${GC_H}
cat >> ${GC_H} <<EOF
#ifdef _MSC_VER
# define LIBGUILEDECL __declspec (dllimport)
@ -407,6 +407,7 @@ EOF
#endif
extern LIBGUILEDECL SCM scm_freelist2;
extern LIBGUILEDECL struct scm_t_freelist scm_master_freelist2;
extern LIBGUILEDECL int scm_block_gc;
EOF
rm -rf ${TMP_UDIR}/guile-*
fi

View File

@ -15,6 +15,9 @@
#include <gncTaxTable.h>
#include <gncVendor.h>
#include <gncBusGuile.h>
#ifdef _MSC_VER
# define snprintf _snprintf
#endif
#include "engine-helpers.h"
#include "gncBusGuile.h"