[pygobject] Fix Build on Visual Studio
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix Build on Visual Studio
- Date: Tue, 25 Feb 2014 07:26:56 +0000 (UTC)
commit df7cba1495c167f1019dec7f4398dc5de62a5937
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Feb 25 14:38:41 2014 +0800
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
gi/pygi-basictype.c | 16 ++++++++++++++++
gi/pygi-cache.c | 3 ++-
gi/pygi-enum-marshal.c | 16 ----------------
3 files changed, 18 insertions(+), 17 deletions(-)
---
diff --git a/gi/pygi-basictype.c b/gi/pygi-basictype.c
index 6fbe929..c9606a9 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 8055c15..abf8e10 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 dec5924..32ca9dc 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]