Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47ec141

Browse files
committed
Added include guards and C++ extern "C" {} constructs. Partial fix for #607253.
Bugfix candidate.
1 parent 2575022 commit 47ec141

5 files changed

Lines changed: 40 additions & 2 deletions

File tree

Include/pymactoolbox.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
22
** pymactoolbox.h - globals defined in mactoolboxglue.c
33
*/
4-
4+
#ifndef Py_PYMACTOOLBOX_H
5+
#define Py_PYMACTOOLBOX_H
56
#ifdef __cplusplus
67
extern "C" {
78
#endif
@@ -197,3 +198,4 @@ extern int OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *);
197198
#ifdef __cplusplus
198199
}
199200
#endif
201+
#endif

Mac/Include/getapplbycreator.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
2121
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2222
2323
******************************************************************/
24+
#ifndef Py_GETAPPLBYCREATOR_H
25+
#define Py_GETALLPBYCREATOR_H
2426

2527
#ifdef WITHOUT_FRAMEWORKS
2628
#include <Types.h>
@@ -29,4 +31,13 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2931
#include <Carbon/Carbon.h>
3032
#endif
3133

34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
3238
extern OSErr FindApplicationFromCreator(OSType, FSSpecPtr);
39+
40+
#ifdef __cplusplus
41+
}
42+
#endif
43+
#endif

Mac/Include/macdefs.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
look-alike file system access functions on the Macintosh.
33
Public domain by Guido van Rossum, CWI, Amsterdam (July 1987).
44
*/
5+
#ifndef Py_MACDEFS_H
6+
#define Py_MACDEFS_H
57

68
#include <Types.h>
79
#include <Files.h>
@@ -14,6 +16,10 @@
1416
#include <TextUtils.h>
1517
#endif
1618

19+
#ifdef __cplusplus
20+
extern "C" {
21+
#endif
22+
1723
/* We may be able to use a std routine in think, don't know */
1824
extern unsigned char *Pstring(char *);
1925
extern char *getbootvol(void);
@@ -33,3 +39,8 @@ extern int sync(void);
3339
#endif
3440
#define EOS '\0'
3541
#define SEP ':'
42+
43+
#ifdef __cplusplus
44+
}
45+
#endif
46+
#endif

Mac/Include/macglue.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
2121
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2222
2323
******************************************************************/
24-
24+
#ifndef Py_MACGLUE_H
25+
#define Py_MACGLUE_H
2526
#ifdef WITHOUT_FRAMEWORKS
2627
#include <Types.h>
2728
#include <Files.h>
@@ -137,3 +138,4 @@ long PyMac_DummyWriteHandler(char *, long);
137138
#ifdef __cplusplus
138139
}
139140
#endif
141+
#endif

Mac/Include/pythonresources.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4040
** Resources that reside in the python executable (or, for
4141
** shared ppc python, in the core dynamic library)
4242
*/
43+
#ifndef Py_PYTHONRESOURCES_H
44+
#define Py_PYTHONRESOURCES_H
45+
46+
#ifdef __cplusplus
47+
extern "C" {
48+
#endif
4349

4450
#define BASE_ID 228
4551

@@ -181,3 +187,9 @@ char * PyMac_GetPythonDir(void);
181187
/* from macmain.c: */
182188
extern PyMac_PrefRecord PyMac_options;
183189
#endif
190+
191+
#ifdef __cplusplus
192+
}
193+
#endif
194+
195+
#endif

0 commit comments

Comments
 (0)