-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
so ceph-mgr can be compiled using py3 Signed-off-by: Kefu Chai <kchai@redhat.com>
- Loading branch information
Showing
8 changed files
with
80 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
#pragma once | ||
|
||
#include "Python.h" | ||
#include "PythonCompat.h" | ||
|
||
extern PyTypeObject BaseMgrStandbyModuleType; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
#include <string> | ||
|
||
#include "Python.h" | ||
#include "PythonCompat.h" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include <Python.h> | ||
|
||
// Python's pyconfig-64.h conflicts with ceph's acconfig.h | ||
#undef HAVE_SYS_WAIT_H | ||
#undef HAVE_UNISTD_H | ||
#undef HAVE_UTIME_H | ||
#undef _POSIX_C_SOURCE | ||
#undef _XOPEN_SOURCE | ||
|
||
#if PY_MAJOR_VERSION >= 3 | ||
inline PyObject* PyString_FromString(const char *v) { | ||
return PyUnicode_FromFormat("%s", v); | ||
} | ||
inline char* PyString_AsString(PyObject *string) { | ||
return PyUnicode_AsUTF8(string); | ||
} | ||
inline long PyInt_AsLong(PyObject *io) { | ||
return PyLong_AsLong(io); | ||
} | ||
inline PyObject* PyInt_FromLong(long ival) { | ||
return PyLong_FromLong(ival); | ||
} | ||
inline int PyString_Check(PyObject *o) { | ||
return PyUnicode_Check(o); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
#pragma once | ||
|
||
#include "Python.h" | ||
#include "PythonCompat.h" | ||
|
||
#include <string> | ||
#include <map> | ||
|