Skip to content

Commit 0f48950

Browse files
committed
修复编译错误
1 parent 0aaf271 commit 0f48950

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

Wrapper/Live2D.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
#include "PyLAppModel.hpp"
1313
#include "PyModel.hpp"
1414

15-
#ifndef Py_IsNone
16-
#define Py_IsNone(o) (o == Py_None)
17-
#endif
18-
1915
static LAppAllocator _cubismAllocator;
2016
static Csm::CubismFramework::Option _cubismOption;
2117

Wrapper/PyLAppModel.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#pragma once
22
#include <LAppModel.hpp>
33

4-
#define Py_LIMITED_API
5-
#include <Python.h>
4+
#include "Python.hpp"
65

76
struct PyLAppModelObject
87
{

Wrapper/PyModel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,10 @@ static PyObject *PyModel_New(PyTypeObject *type, PyObject *args, PyObject *kwarg
736736
}
737737

738738
static PyType_Slot PyModel_slots[] = {
739-
{Py_tp_new, PyModel_New},
740-
{Py_tp_init, PyModel_Init},
741-
{Py_tp_dealloc, PyModel_Dealloc},
742-
{Py_tp_methods, PyModel_Methods},
739+
{Py_tp_new, (void*)PyModel_New},
740+
{Py_tp_init, (void*)PyModel_Init},
741+
{Py_tp_dealloc, (void*)PyModel_Dealloc},
742+
{Py_tp_methods, (void*)PyModel_Methods},
743743
{0, 0},
744744
};
745745

Wrapper/PyModel.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
#include <fine-grained/Model.hpp>
44

5-
#define Py_LIMITED_API
6-
#include <Python.h>
5+
#include "Python.hpp"
76

87
struct PyModelObject {
98
PyObject_HEAD

Wrapper/Python.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#pragma once
2+
#define Py_LIMITED_API
3+
#include <Python.h>
4+
5+
#ifndef Py_IsNone
6+
#define Py_IsNone(o) (o == Py_None)
7+
#endif

cmake/Wrapper.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Create Wrapper
22
set(Wrapper Live2DWrapper)
33
add_library(${Wrapper} SHARED
4+
${PROJECT_ROOT}/Wrapper/Python.hpp
45
${PROJECT_ROOT}/Wrapper/Live2D.cpp
56
${PROJECT_ROOT}/Wrapper/PyLAppModel.hpp
67
${PROJECT_ROOT}/Wrapper/PyLAppModel.cpp

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools.command.bdist_wheel import bdist_wheel
1111

1212
NAME = "live2d-py"
13-
VERSION = "0.4.6" # TODO: edit before push
13+
VERSION = "0.5.0" # TODO: edit before push
1414
DESCRIPTION = "Live2D Python SDK"
1515
LONG_DESCRIPTION = open("README.md", "r", encoding="utf-8").read().replace("./", "https://raw.githubusercontent.com/Arkueid/live2d-py/refs/heads/main/")
1616
AUTHOR = "Arkueid"

0 commit comments

Comments
 (0)