| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9cb64b9 commit 938ace6
61 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -616,28 +616,19 @@ extern DL_IMPORT(PyObject) _Py_NotImplementedStruct; /* Don't use this directly | |||
| 616 | 616 | #define Py_GE 5 | |
| 617 | 617 | ||
| 618 | 618 | /* | |
| 619 | - A common programming style in Python requires the forward declaration | ||
| 620 | - of static, initialized structures, e.g. for a type object that is used | ||
| 621 | - by the functions whose address must be used in the initializer. | ||
| 622 | - Some compilers (notably SCO ODT 3.0, I seem to remember early AIX as | ||
| 623 | - well) botch this if you use the static keyword for both declarations | ||
| 624 | - (they allocate two objects, and use the first, uninitialized one until | ||
| 625 | - the second declaration is encountered). Therefore, the forward | ||
| 626 | - declaration should use the 'forwardstatic' keyword. This expands to | ||
| 627 | - static on most systems, but to extern on a few. The actual storage | ||
| 628 | - and name will still be static because the second declaration is | ||
| 629 | - static, so no linker visible symbols will be generated. (Standard C | ||
| 630 | - compilers take offense to the extern forward declaration of a static | ||
| 631 | - object, so I can't just put extern in all cases. :-( ) | ||
| 619 | + Define staticforward and statichere for source compatibility with old | ||
| 620 | + C extensions. | ||
| 621 | + | ||
| 622 | + The staticforward define was needed to support certain broken C | ||
| 623 | + compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the | ||
| 624 | + static keyword when it was used with a forward declaration of a static | ||
| 625 | + initialized structure. Standard C allows the forward declaration with | ||
| 626 | + static, and we've decided to stop catering to broken C compilers. | ||
| 627 | + (In fact, we expect that the compilers are all fixed eight years later.) | ||
| 632 | 628 | */ | |
| 633 | 629 | ||
| 634 | - #ifdef BAD_STATIC_FORWARD | ||
| 635 | - #define staticforward extern | ||
| 636 | - #define statichere static | ||
| 637 | - #else /* !BAD_STATIC_FORWARD */ | ||
| 638 | 630 | #define staticforward static | |
| 639 | 631 | #define statichere static | |
| 640 | - #endif /* !BAD_STATIC_FORWARD */ | ||
| 641 | 632 | ||
| 642 | 633 | ||
| 643 | 634 | /* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ typedef struct { | |||
| 23 | 23 | PyObject *x_attr; /* Attributes dictionary */ | |
| 24 | 24 | } XxoObject; | |
| 25 | 25 | ||
| 26 | - staticforward PyTypeObject Xxo_Type; | ||
| 26 | + static PyTypeObject Xxo_Type; | ||
| 27 | 27 | ||
| 28 | 28 | #define XxoObject_Check(v) ((v)->ob_type == &Xxo_Type) | |
| 29 | 29 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -233,7 +233,7 @@ typedef struct { | |||
| 233 | 233 | NavReplyRecord itself; | |
| 234 | 234 | } navrrobject; | |
| 235 | 235 | ||
| 236 | - staticforward PyTypeObject Navrrtype; | ||
| 236 | + static PyTypeObject Navrrtype; | ||
| 237 | 237 | ||
| 238 | 238 | ||
| 239 | 239 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -471,7 +471,7 @@ typedef struct { | |||
| 471 | 471 | char name[MAXNAME+1]; | |
| 472 | 472 | } cdfobject; | |
| 473 | 473 | ||
| 474 | - staticforward PyTypeObject Cdftype; | ||
| 474 | + static PyTypeObject Cdftype; | ||
| 475 | 475 | ||
| 476 | 476 | ||
| 477 | 477 | ||
@@ -485,7 +485,7 @@ typedef struct { | |||
| 485 | 485 | char name[MAXNAME+1]; | |
| 486 | 486 | } cdrobject; | |
| 487 | 487 | ||
| 488 | - staticforward PyTypeObject Cdrtype; | ||
| 488 | + static PyTypeObject Cdrtype; | ||
| 489 | 489 | ||
| 490 | 490 | ||
| 491 | 491 | ||
@@ -503,7 +503,7 @@ typedef struct { | |||
| 503 | 503 | conventry *argconv[MAXARG]; /* Value converter list */ | |
| 504 | 504 | } cdcobject; | |
| 505 | 505 | ||
| 506 | - staticforward PyTypeObject Cdctype; | ||
| 506 | + static PyTypeObject Cdctype; | ||
| 507 | 507 | ||
| 508 | 508 | ||
| 509 | 509 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,7 @@ typedef struct { | |||
| 80 | 80 | int err; /* Error to pass to the callback */ | |
| 81 | 81 | } ctbcmobject; | |
| 82 | 82 | ||
| 83 | - staticforward PyTypeObject ctbcmtype; | ||
| 83 | + static PyTypeObject ctbcmtype; | ||
| 84 | 84 | ||
| 85 | 85 | #define is_ctbcmobject(v) ((v)->ob_type == &ctbcmtype) | |
| 86 | 86 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ extern int _CtlObj_Convert(PyObject *, ControlHandle *); | |||
| 35 | 35 | #define CtlObj_Convert _CtlObj_Convert | |
| 36 | 36 | #endif | |
| 37 | 37 | ||
| 38 | - staticforward PyObject *CtlObj_WhichControl(ControlHandle); | ||
| 38 | + static PyObject *CtlObj_WhichControl(ControlHandle); | ||
| 39 | 39 | ||
| 40 | 40 | #define as_Control(h) ((ControlHandle)h) | |
| 41 | 41 | #define as_Resource(ctl) ((Handle)ctl) | |
@@ -139,9 +139,9 @@ static ControlUserPaneIdleUPP myidleproc_upp; | |||
| 139 | 139 | static ControlUserPaneHitTestUPP myhittestproc_upp; | |
| 140 | 140 | static ControlUserPaneTrackingUPP mytrackingproc_upp; | |
| 141 | 141 | ||
| 142 | - staticforward int settrackfunc(PyObject *); /* forward */ | ||
| 143 | - staticforward void clrtrackfunc(void); /* forward */ | ||
| 144 | - staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *); | ||
| 142 | + static int settrackfunc(PyObject *); /* forward */ | ||
| 143 | + static void clrtrackfunc(void); /* forward */ | ||
| 144 | + static int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *); | ||
| 145 | 145 | ||
| 146 | 146 | static PyObject *Ctl_Error; | |
| 147 | 147 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ typedef struct { | |||
| 43 | 43 | short forkref; | |
| 44 | 44 | } forkRefObject; | |
| 45 | 45 | ||
| 46 | - staticforward PyTypeObject forkRefObject_Type; | ||
| 46 | + static PyTypeObject forkRefObject_Type; | ||
| 47 | 47 | ||
| 48 | 48 | #define forkRefObject_Check(v) ((v)->ob_type == &forkRefObject_Type) | |
| 49 | 49 | ||
@@ -359,7 +359,7 @@ typedef struct { | |||
| 359 | 359 | FSIterator iterator; | |
| 360 | 360 | } iteratorObject; | |
| 361 | 361 | ||
| 362 | - staticforward PyTypeObject iteratorObject_Type; | ||
| 362 | + static PyTypeObject iteratorObject_Type; | ||
| 363 | 363 | ||
| 364 | 364 | #define iteratorObject_Check(v) ((v)->ob_type == &iteratorObject_Type) | |
| 365 | 365 | ||
@@ -534,7 +534,7 @@ typedef struct { | |||
| 534 | 534 | Boolean directory; | |
| 535 | 535 | } fsRefObject; | |
| 536 | 536 | ||
| 537 | - staticforward PyTypeObject fsRefObject_Type; | ||
| 537 | + static PyTypeObject fsRefObject_Type; | ||
| 538 | 538 | ||
| 539 | 539 | #define fsRefObject_Check(v) ((v)->ob_type == &fsRefObject_Type) | |
| 540 | 540 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ typedef struct { | |||
| 61 | 61 | ICInstance inst; | |
| 62 | 62 | } iciobject; | |
| 63 | 63 | ||
| 64 | - staticforward PyTypeObject Icitype; | ||
| 64 | + static PyTypeObject Icitype; | ||
| 65 | 65 | ||
| 66 | 66 | ||
| 67 | 67 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,7 +70,7 @@ typedef struct { | |||
| 70 | 70 | AliasHandle alias; | |
| 71 | 71 | } mfsaobject; | |
| 72 | 72 | ||
| 73 | - staticforward PyTypeObject Mfsatype; | ||
| 73 | + static PyTypeObject Mfsatype; | ||
| 74 | 74 | ||
| 75 | 75 | #define is_mfsaobject(v) ((v)->ob_type == &Mfsatype) | |
| 76 | 76 | ||
@@ -82,7 +82,7 @@ typedef struct { | |||
| 82 | 82 | FSSpec fsspec; | |
| 83 | 83 | } mfssobject; | |
| 84 | 84 | ||
| 85 | - staticforward PyTypeObject Mfsstype; | ||
| 85 | + static PyTypeObject Mfsstype; | ||
| 86 | 86 | ||
| 87 | 87 | #define is_mfssobject(v) ((v)->ob_type == &Mfsstype) | |
| 88 | 88 | ||
@@ -94,7 +94,7 @@ typedef struct { | |||
| 94 | 94 | FSRef fsref; | |
| 95 | 95 | } mfsrobject; | |
| 96 | 96 | ||
| 97 | - staticforward PyTypeObject Mfsrtype; | ||
| 97 | + static PyTypeObject Mfsrtype; | ||
| 98 | 98 | ||
| 99 | 99 | #define is_mfsrobject(v) ((v)->ob_type == &Mfsrtype) | |
| 100 | 100 | ||
@@ -107,13 +107,13 @@ typedef struct { | |||
| 107 | 107 | FInfo finfo; | |
| 108 | 108 | } mfsiobject; | |
| 109 | 109 | ||
| 110 | - staticforward PyTypeObject Mfsitype; | ||
| 110 | + static PyTypeObject Mfsitype; | ||
| 111 | 111 | ||
| 112 | 112 | #define is_mfsiobject(v) ((v)->ob_type == &Mfsitype) | |
| 113 | 113 | ||
| 114 | 114 | ||
| 115 | - staticforward mfssobject *newmfssobject(FSSpec *fss); /* Forward */ | ||
| 116 | - staticforward mfsrobject *newmfsrobject(FSRef *fsr); /* Forward */ | ||
| 115 | + static mfssobject *newmfssobject(FSSpec *fss); /* Forward */ | ||
| 116 | + static mfsrobject *newmfsrobject(FSRef *fsr); /* Forward */ | ||
| 117 | 117 | ||
| 118 | 118 | /* ---------------------------------------------------------------- */ | |
| 119 | 119 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ typedef struct { | |||
| 60 | 60 | int isclosed; | |
| 61 | 61 | } rfobject; | |
| 62 | 62 | ||
| 63 | - staticforward PyTypeObject Rftype; | ||
| 63 | + static PyTypeObject Rftype; | ||
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | 66 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments