Commit df7cba14 authored by Chun-wei Fan's avatar Chun-wei Fan Committed by Simon Feltman

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
parent bb5550bc
......@@ -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
......
......@@ -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 */
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment