Commit f8a75b89 authored by Neil Schemenauer's avatar Neil Schemenauer

Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC

might use __attribute__ in other ways (e.g. CodeWarrior).
parent bf0630aa
...@@ -10,9 +10,9 @@ extern "C" { ...@@ -10,9 +10,9 @@ extern "C" {
#include "Python.h" #include "Python.h"
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
__attribute__((format(printf, 1, 2))); Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
__attribute__((format(printf, 1, 2))); Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
#define addarc _Py_addarc #define addarc _Py_addarc
#define addbit _Py_addbit #define addbit _Py_addbit
......
...@@ -83,7 +83,7 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void); ...@@ -83,7 +83,7 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
__attribute__((format(printf, 2, 3))); Py_GCC_ATTRIBUTE((format(printf, 2, 3)));
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
...@@ -195,9 +195,9 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason( ...@@ -195,9 +195,9 @@ PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
#include <stdarg.h> #include <stdarg.h>
PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...) PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
__attribute__((format(printf, 3, 4))); Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va) PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
__attribute__((format(printf, 3, 0))); Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -531,7 +531,9 @@ typedef struct fd_set { ...@@ -531,7 +531,9 @@ typedef struct fd_set {
#if (!defined(__GNUC__) || __GNUC__ < 2 || \ #if (!defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \
!defined(RISCOS) !defined(RISCOS)
#define __attribute__(__x) #define Py_GCC_ATTRIBUTE(x)
#else
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
#endif #endif
#endif /* Py_PYPORT_H */ #endif /* Py_PYPORT_H */
...@@ -52,9 +52,9 @@ PyAPI_DATA(PyTypeObject) PyString_Type; ...@@ -52,9 +52,9 @@ PyAPI_DATA(PyTypeObject) PyString_Type;
PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, int); PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, int);
PyAPI_FUNC(PyObject *) PyString_FromString(const char *); PyAPI_FUNC(PyObject *) PyString_FromString(const char *);
PyAPI_FUNC(PyObject *) PyString_FromFormatV(const char*, va_list) PyAPI_FUNC(PyObject *) PyString_FromFormatV(const char*, va_list)
__attribute__((format(printf, 1, 0))); Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
PyAPI_FUNC(PyObject *) PyString_FromFormat(const char*, ...) PyAPI_FUNC(PyObject *) PyString_FromFormat(const char*, ...)
__attribute__((format(printf, 1, 2))); Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
PyAPI_FUNC(int) PyString_Size(PyObject *); PyAPI_FUNC(int) PyString_Size(PyObject *);
PyAPI_FUNC(char *) PyString_AsString(PyObject *); PyAPI_FUNC(char *) PyString_AsString(PyObject *);
PyAPI_FUNC(PyObject *) PyString_Repr(PyObject *, int); PyAPI_FUNC(PyObject *) PyString_Repr(PyObject *, int);
......
...@@ -14,9 +14,9 @@ PyAPI_FUNC(void) PySys_SetArgv(int, char **); ...@@ -14,9 +14,9 @@ PyAPI_FUNC(void) PySys_SetArgv(int, char **);
PyAPI_FUNC(void) PySys_SetPath(char *); PyAPI_FUNC(void) PySys_SetPath(char *);
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
__attribute__((format(printf, 1, 2))); Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
__attribute__((format(printf, 1, 2))); Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc; PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
PyAPI_DATA(int) _PySys_CheckInterval; PyAPI_DATA(int) _PySys_CheckInterval;
......
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