diff options
| author | Christian Heimes <christian@cheimes.de> | 2012-10-17 23:52:17 +0200 |
|---|---|---|
| committer | Christian Heimes <christian@cheimes.de> | 2012-10-17 23:52:17 +0200 |
| commit | 743e0cd6b5d59767aae2524700857f188ca1e80e (patch) | |
| tree | 89897c0424a3b361e04d451e2b3a64e5c7c17756 /Include/pyport.h | |
| parent | 1e9af84e2ef41115dd07d00b57e5a2a7041bfeed (diff) | |
| download | cpython-git-743e0cd6b5d59767aae2524700857f188ca1e80e.tar.gz | |
Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
endianess detection and handling.
Diffstat (limited to 'Include/pyport.h')
| -rw-r--r-- | Include/pyport.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index 284e6da747..baa04fee17 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -865,4 +865,18 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #endif #endif +/* + * Convenient macros to deal with endianess of the platform. WORDS_BIGENDIAN is + * detected by configure and defined in pyconfig.h. The code in pyconfig.h + * also also takes care of Apple's universal builds. + */ + +#ifdef WORDS_BIGENDIAN +#define PY_BIG_ENDIAN 1 +#define PY_LITTLE_ENDIAN 0 +#else +#define PY_BIG_ENDIAN 0 +#define PY_LITTLE_ENDIAN 1 +#endif + #endif /* Py_PYPORT_H */ |
