Skip to content

Commit

Permalink
Include Python.h first
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Oct 1, 2024
1 parent e78ebd3 commit a72279e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions pandas/_libs/include/pandas/datetime/date_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The full license is in the LICENSE file, distributed with this software.

#define PY_SSIZE_T_CLEAN
#include <Python.h>

#include <numpy/ndarraytypes.h>

// Scales value inplace from nanosecond resolution to unit resolution
Expand Down
3 changes: 2 additions & 1 deletion pandas/_libs/include/pandas/parser/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ The full license is in the LICENSE file, distributed with this software.
#pragma once

#define PY_SSIZE_T_CLEAN
#include "tokenizer.h"
#include <Python.h>

#include "tokenizer.h"

#define FS(source) ((file_source *)source)

typedef struct _rd_source {
Expand Down
3 changes: 2 additions & 1 deletion pandas/_libs/include/pandas/parser/pd_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ extern "C" {
#endif

#define PY_SSIZE_T_CLEAN
#include "pandas/parser/tokenizer.h"
#include <Python.h>

#include "pandas/parser/tokenizer.h"

typedef struct {
int (*to_double)(char *, double *, char, char, int *);
int (*floatify)(PyObject *, double *, int *);
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/include/pandas/vendored/klib/khash_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <Python.h>

#include <pymem.h>
#include <string.h>

Expand Down
3 changes: 1 addition & 2 deletions pandas/_libs/src/vendored/ujson/python/JSONtoObj.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ Numeric decoder derived from TCL library

// Licence at LICENSES/ULTRAJSON_LICENSE

// clang-format off
#define PY_SSIZE_T_CLEAN
#include <Python.h>

#include "pandas/vendored/ujson/lib/ultrajson.h"
// clang-format on

static int Object_objectAddKey(void *Py_UNUSED(prv), JSOBJ obj, JSOBJ name,
JSOBJ value) {
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/src/vendored/ujson/python/ujson.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Numeric decoder derived from TCL library

#define PY_SSIZE_T_CLEAN
#include <Python.h>

#define PY_ARRAY_UNIQUE_SYMBOL UJSON_NUMPY
#include "numpy/arrayobject.h"

Expand Down

0 comments on commit a72279e

Please sign in to comment.