Mercurial > cpython-lru_cache-weakref
comparison Include/Python.h @ 14497:d327fc47f8fd legacy-trunk
Close SF bug 110826: a complaint about the way Python #define'd NULL.
It's hard to sort out what the bug was, exactly. So, Big Hammer:
1. Python shouldn't be in the business of #define'ing NULL, period.
2. Users of the Python C API shouldn't be in the business of not including
Python.h, period.
Hence:
1. Removed all #define's of NULL in Python source code (pyport.h and
object.h).
2. Since we're *relying* on stdio.h defining NULL, put an #error in
Python.h after its #include of stdio.h if NULL isn't defined then.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Sun, 10 Sep 2000 01:02:41 +0000 |
| parents | 6f6f965c5e2d |
| children | 756c8c6535fe |
comparison
equal
deleted
inserted
replaced
| 14496:aed37f5aa475 | 14497:d327fc47f8fd |
|---|---|
| 34 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) | 34 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) |
| 35 #define _SGI_MP_SOURCE | 35 #define _SGI_MP_SOURCE |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #include <stdio.h> | 38 #include <stdio.h> |
| 39 #ifndef NULL | |
| 40 # error "Python.h requires that stdio.h define NULL." | |
| 41 #endif | |
| 42 | |
| 39 #include <string.h> | 43 #include <string.h> |
| 40 #include <errno.h> | 44 #include <errno.h> |
| 41 #ifdef HAVE_STDLIB_H | 45 #ifdef HAVE_STDLIB_H |
| 42 #include <stdlib.h> | 46 #include <stdlib.h> |
| 43 #endif | 47 #endif |
