Skip to content

Commit

Permalink
Fixes for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Oct 28, 2014
1 parent 7ac0f2b commit 3147d8d
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 20 deletions.
6 changes: 6 additions & 0 deletions extern/ttconv/pprdrv_tt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
#include "pprdrv.h"
#include "truetype.h"
#include <sstream>
#ifdef _POSIX_C_SOURCE
# undef _POSIX_C_SOURCE
#endif
#ifdef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif
#include <Python.h>

/*==========================================================================
Expand Down
3 changes: 0 additions & 3 deletions src/_backend_agg_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
#if defined(__SUNPRO_C) || defined(_MSC_VER)
int _dummy;
#endif
};

#if PY3K
Expand Down
3 changes: 0 additions & 3 deletions src/_gtkagg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
#if defined(__SUNPRO_C) || defined(_MSC_VER)
int _dummy;
#endif
};

#if PY3K
Expand Down
3 changes: 0 additions & 3 deletions src/_image_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
#if defined(__SUNPRO_C) || defined(_MSC_VER)
int _dummy;
#endif
};

#if PY3K
Expand Down
3 changes: 0 additions & 3 deletions src/_path_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
#if defined(__SUNPRO_C) || defined(_MSC_VER)
int _dummy;
#endif
};

#if PY3K
Expand Down
3 changes: 0 additions & 3 deletions src/_png.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
#if defined(__SUNPRO_C) || defined(_MSC_VER)
int _dummy;
#endif
};

#if PY3K
Expand Down
3 changes: 0 additions & 3 deletions src/ft2font_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,10 +1618,7 @@ extern "C" {

struct module_state
{
/* The Sun compiler can't handle empty structs */
#if defined(__SUNPRO_C) || defined(_MSC_VER)
int _dummy;
#endif
};

#if PY3K
Expand Down
7 changes: 7 additions & 0 deletions src/mplutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ typedef unsigned __int8 uint8_t;
#include <stdint.h>
#endif

#ifdef _POSIX_C_SOURCE
# undef _POSIX_C_SOURCE
#endif
#ifdef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif

#include <Python.h>

#if PY_MAJOR_VERSION >= 3
Expand Down
7 changes: 7 additions & 0 deletions src/numpy_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@

#include <complex>

#ifdef _POSIX_C_SOURCE
# undef _POSIX_C_SOURCE
#endif
#ifdef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif

#include <Python.h>
#include <numpy/ndarrayobject.h>

Expand Down
4 changes: 2 additions & 2 deletions src/py_converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,13 @@ int convert_offset_position(PyObject *obj, void *offsetp)
e_offset_position *offset = (e_offset_position *)offsetp;
const char *names[] = {"data", NULL};
int values[] = {OFFSET_POSITION_DATA};
int result = OFFSET_POSITION_FIGURE;
int result = (int)OFFSET_POSITION_FIGURE;

if (!convert_string_enum(obj, "offset_position", names, values, &result)) {
PyErr_Clear();
}

*offset = result;
*offset = (e_offset_position)result;

return 1;
}
Expand Down

0 comments on commit 3147d8d

Please sign in to comment.