summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2014-02-25 14:38:41 +0800
committerSimon Feltman <sfeltman@src.gnome.org>2014-02-24 23:22:45 -0800
commitdf7cba1495c167f1019dec7f4398dc5de62a5937 (patch)
tree187b872e66a6bb51e729ee5d11f09d60c22a7761
parentbb5550bc85ac0ff60ea39912416e347f27853fb4 (diff)
downloadpygobject-df7cba1495c167f1019dec7f4398dc5de62a5937.tar.gz
Fix Build on Visual Studio
Some items from pygi-enum-marshal.c were moved to pygi-basictype.c, which included the use of the NAN and INFINITY macros/constants, so the definitions for those need to be moved to pygi-basictype.c as well. Also avoid defining a variable in the middle of the block. https://bugzilla.gnome.org/show_bug.cgi?id=725122
-rw-r--r--gi/pygi-basictype.c16
-rw-r--r--gi/pygi-cache.c3
-rw-r--r--gi/pygi-enum-marshal.c16
3 files changed, 18 insertions, 17 deletions
diff --git a/gi/pygi-basictype.c b/gi/pygi-basictype.c
index 6fbe9292..c9606a93 100644
--- a/gi/pygi-basictype.c
+++ b/gi/pygi-basictype.c
@@ -25,6 +25,22 @@
#include "pygi-argument.h"
#include "pygi-private.h"
+#ifdef G_OS_WIN32
+#ifdef _MSC_VER
+#include <math.h>
+
+#ifndef NAN
+static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
+#define NAN (*(const float *) __nan)
+#endif
+
+#ifndef INFINITY
+#define INFINITY HUGE_VAL
+#endif
+
+#endif
+#endif
+
/*
* From Python Marshaling
diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c
index 8055c155..abf8e100 100644
--- a/gi/pygi-cache.c
+++ b/gi/pygi-cache.c
@@ -475,6 +475,7 @@ _args_cache_generate (GICallableInfo *callable_info,
GITransfer return_transfer;
PyGIArgCache *return_cache;
PyGIDirection return_direction;
+ gssize last_explicit_arg_index;
/* Return arguments are always considered out */
return_direction = _pygi_get_direction (callable_cache, GI_DIRECTION_OUT);
@@ -637,7 +638,7 @@ _args_cache_generate (GICallableInfo *callable_info,
callable_cache->n_py_required_args = 0;
callable_cache->user_data_varargs_index = -1;
- gssize last_explicit_arg_index = -1;
+ last_explicit_arg_index = -1;
/* Reverse loop through all the arguments to setup arg_name_list/hash
* and find the number of required arguments */
diff --git a/gi/pygi-enum-marshal.c b/gi/pygi-enum-marshal.c
index dec59243..32ca9dcd 100644
--- a/gi/pygi-enum-marshal.c
+++ b/gi/pygi-enum-marshal.c
@@ -25,22 +25,6 @@
#include "pygi-enum-marshal.h"
#include "pygi-private.h"
-#ifdef _WIN32
-#ifdef _MSC_VER
-#include <math.h>
-
-#ifndef NAN
-static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
-#define NAN (*(const float *) __nan)
-#endif
-
-#ifndef INFINITY
-#define INFINITY HUGE_VAL
-#endif
-
-#endif
-#endif
-
static gboolean
gi_argument_from_c_long (GIArgument *arg_out,
long c_long_in,