Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11036
Modified Files:
PyACL.cpp PyHANDLE.cpp PyIID.cpp PyLARGE_INTEGER.cpp
PyOVERLAPPED.cpp PySECURITY_ATTRIBUTES.cpp
PySECURITY_DESCRIPTOR.cpp PySID.cpp PyTime.cpp PyUnicode.cpp
PyWinTypes.h PyWinTypesmodule.cpp win32apimodule.cpp
Log Message:
* Rationalize the headers - PyWinTypes.h now pulls in python.h and
windows.h, giving a handy choke-point to tweak #define/#include
weirdness.
* Undefine _POSIX_C_SOURCE if being built with GCC.
* Move some of the CE hacks, and add comments that they are old.
The C++ files now just include pywintypes instead of all these headers
manually.
Index: PyACL.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyACL.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PyACL.cpp 31 Oct 2003 12:08:00 -0000 1.5
--- PyACL.cpp 7 Nov 2003 03:58:17 -0000 1.6
***************
*** 2,11 ****
// @doc
- #include "Python.h"
- #ifndef MS_WINCE /* This source is not included for WinCE */
- #include "windows.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
#include "accctrl.h"
#include "aclapi.h"
--- 2,10 ----
// @doc
#include "PyWinTypes.h"
+
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
+ #ifndef MS_WINCE /* This source is not included for WinCE */
#include "accctrl.h"
#include "aclapi.h"
Index: PyHANDLE.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PyHANDLE.cpp 23 Oct 2003 04:11:39 -0000 1.7
--- PyHANDLE.cpp 7 Nov 2003 03:58:17 -0000 1.8
***************
*** 2,10 ****
// @doc
- #include "windows.h"
- #include "Python.h"
- #include "structmember.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
// @pymethod <o PyHANDLE>|pywintypes|HANDLE|Creates a new HANDLE object
--- 2,8 ----
// @doc
#include "PyWinTypes.h"
#include "PyWinObjects.h"
+ #include "structmember.h"
// @pymethod <o PyHANDLE>|pywintypes|HANDLE|Creates a new HANDLE object
Index: PyIID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PyIID.cpp 31 Oct 2003 12:07:04 -0000 1.5
--- PyIID.cpp 7 Nov 2003 03:58:17 -0000 1.6
***************
*** 4,9 ****
// @doc
- #include "windows.h"
- #include "Python.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
--- 4,7 ----
Index: PyLARGE_INTEGER.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyLARGE_INTEGER.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** PyLARGE_INTEGER.cpp 7 Apr 2003 03:38:27 -0000 1.6
--- PyLARGE_INTEGER.cpp 7 Nov 2003 03:58:17 -0000 1.7
***************
*** 22,27 ****
// Hopefully Python will formalise an API for this?
- #include "windows.h"
- #include "Python.h"
#include "PyWinTypes.h"
#include "longintrepr.h"
--- 22,25 ----
Index: PyOVERLAPPED.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyOVERLAPPED.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PyOVERLAPPED.cpp 7 Apr 2003 14:02:27 -0000 1.7
--- PyOVERLAPPED.cpp 7 Nov 2003 03:58:17 -0000 1.8
***************
*** 2,11 ****
// @doc
- #include "windows.h"
- #include "Python.h"
- #include "structmember.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "assert.h"
// @pymethod <o PyOVERLAPPED>|pywintypes|OVERLAPPED|Creates a new OVERLAPPED object
--- 2,9 ----
// @doc
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "assert.h"
+ #include "structmember.h"
// @pymethod <o PyOVERLAPPED>|pywintypes|OVERLAPPED|Creates a new OVERLAPPED object
Index: PySECURITY_ATTRIBUTES.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_ATTRIBUTES.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PySECURITY_ATTRIBUTES.cpp 10 Mar 2003 01:18:16 -0000 1.4
--- PySECURITY_ATTRIBUTES.cpp 7 Nov 2003 03:58:17 -0000 1.5
***************
*** 2,11 ****
// @doc
- #include "windows.h"
- #include "Python.h"
- #include "structmember.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
#ifdef MS_WINCE
--- 2,9 ----
// @doc
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
+ #include "structmember.h"
#ifdef MS_WINCE
Index: PySECURITY_DESCRIPTOR.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PySECURITY_DESCRIPTOR.cpp 29 Jul 2003 06:47:58 -0000 1.9
--- PySECURITY_DESCRIPTOR.cpp 7 Nov 2003 03:58:17 -0000 1.10
***************
*** 2,11 ****
// @doc
- #include "windows.h"
- #include "Python.h"
- #include "structmember.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
#ifndef MS_WINCE /* This code is not available on Windows CE */
--- 2,9 ----
// @doc
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
+ #include "structmember.h"
#ifndef MS_WINCE /* This code is not available on Windows CE */
Index: PySID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PySID.cpp 10 Mar 2003 01:18:16 -0000 1.7
--- PySID.cpp 7 Nov 2003 03:58:17 -0000 1.8
***************
*** 2,7 ****
// @doc
- #include "windows.h"
- #include "Python.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
--- 2,5 ----
Index: PyTime.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PyTime.cpp 18 Oct 2003 23:36:21 -0000 1.8
--- PyTime.cpp 7 Nov 2003 03:58:17 -0000 1.9
***************
*** 3,8 ****
//
// @doc
- #include "windows.h"
- #include "Python.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
--- 3,6 ----
Index: PyUnicode.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyUnicode.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** PyUnicode.cpp 31 Oct 2003 04:58:18 -0000 1.16
--- PyUnicode.cpp 7 Nov 2003 03:58:17 -0000 1.17
***************
*** 4,9 ****
// @doc
- #include "windows.h"
- #include "Python.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
--- 4,7 ----
Index: PyWinTypes.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** PyWinTypes.h 1 Sep 2003 08:13:12 -0000 1.16
--- PyWinTypes.h 7 Nov 2003 03:58:17 -0000 1.17
***************
*** 3,17 ****
#define __PYWINTYPES_H__
! /* DAA: restore macros for building under CE */
! #ifndef IN
! #define IN
! #endif
! #ifdef OUT
! #undef OUT
! #endif
! #ifndef OUT
! #define OUT
#endif
// Do we want to use the builtin Unicode object?
// If defined, we use the standard builtin type.
--- 3,17 ----
#define __PYWINTYPES_H__
! // If building under a GCC, tweak what we need.
! #if defined(__GNUC__) && defined(_POSIX_C_SOURCE)
! // python.h complains if _POSIX_C_SOURCE is already defined
! # undef _POSIX_C_SOURCE
#endif
+ // Python.h and Windows.h both protect themselves from multiple
+ // includes - so it is safe to do here (and provides a handy
+ // choke point for #include vagaries
+ #include "Python.h"
+ #include "windows.h"
// Do we want to use the builtin Unicode object?
// If defined, we use the standard builtin type.
***************
*** 19,23 ****
// (but that doesnt work seamlessly with PyString objects)
! // For 1.6 builds, this will be ON.
// For 1.5 builds, this will be OFF
#if (PY_VERSION_HEX >= 0x01060000)
--- 19,23 ----
// (but that doesnt work seamlessly with PyString objects)
! // For 1.6+ builds, this will be ON.
// For 1.5 builds, this will be OFF
#if (PY_VERSION_HEX >= 0x01060000)
***************
*** 25,29 ****
#endif
!
#ifdef FREEZE_PYWINTYPES
/* The pywintypes module is being included in a frozen .EXE/.DLL */
--- 25,31 ----
#endif
! // *** NOTE *** FREEZE_PYWINTYPES is deprecated. It used to be used
! // by the 'freeze' tool, but now py2exe etc do a far better job, and
! // don't require a custom built pywintypes DLL.
#ifdef FREEZE_PYWINTYPES
/* The pywintypes module is being included in a frozen .EXE/.DLL */
***************
*** 48,57 ****
#include <tchar.h>
#ifdef MS_WINCE
// Having trouble making these work for Palm PCs??
! #ifndef PYWIN_HPC /* Palm PC */
! #define NO_PYWINTYPES_TIME
! #define NO_PYWINTYPES_IID
! #define NO_PYWINTYPES_BSTR
! #endif
#endif // MS_WINCE
/*
--- 50,72 ----
#include <tchar.h>
#ifdef MS_WINCE
+ // These macros caused grief on CE once (do they still?)
+ # ifndef IN
+ # define IN
+ # endif
+ # ifdef OUT
+ # undef OUT
+ # endif
+ # ifndef OUT
+ # define OUT
+ # endif
// Having trouble making these work for Palm PCs??
! // NOTE: These are old - for Windows CE 1 devices, and well
! // before the PPC platform. It is unlikely recent CE toolkits
! // still need all this magic.
! # ifndef PYWIN_HPC /* Palm PC */
! # define NO_PYWINTYPES_TIME
! # define NO_PYWINTYPES_IID
! # define NO_PYWINTYPES_BSTR
! # endif
#endif // MS_WINCE
/*
Index: PyWinTypesmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PyWinTypesmodule.cpp 31 Oct 2003 02:54:12 -0000 1.11
--- PyWinTypesmodule.cpp 7 Nov 2003 03:58:17 -0000 1.12
***************
*** 13,23 ****
******************************************************************/
- #include "windows.h"
- #include "malloc.h"
-
- #include "Python.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
PyObject * PyWinExc_ApiError = NULL;
--- 13,20 ----
******************************************************************/
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
+ #include "malloc.h"
PyObject * PyWinExc_ApiError = NULL;
Index: win32apimodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** win32apimodule.cpp 31 Oct 2003 12:06:07 -0000 1.30
--- win32apimodule.cpp 7 Nov 2003 03:58:17 -0000 1.31
***************
*** 13,22 ****
******************************************************************/
- #include "windows.h"
-
- #define Py_USE_NEW_NAMES
-
-
- #include "Python.h"
#include "PyWinTypes.h"
#include "PyWinObjects.h"
--- 13,16 ----
|