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

Skip to content

Commit 74a1e63

Browse files
committed
Test for TARGET_API_MAC_CARBON with #if in stead of #ifdef.
1 parent 2d391f2 commit 74a1e63

44 files changed

Lines changed: 223 additions & 223 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Mac/Compat/getwd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ getwd(char *cwd)
5353
sprintf(cwd, "I/O error %d in PBHGetVolSync", err);
5454
return NULL;
5555
}
56-
#ifdef TARGET_API_MAC_CARBON
56+
#if TARGET_API_MAC_CARBON
5757
p2cstrcpy(cwd, (StringPtr)cwd);
5858
ecwd = strchr(cwd, EOS);
5959
#else
@@ -77,7 +77,7 @@ getwd(char *cwd)
7777
return NULL;
7878
}
7979
dirid= pb.d.ioDrParID;
80-
#ifdef TARGET_API_MAC_CARBON
80+
#if TARGET_API_MAC_CARBON
8181
p2cstrcpy(ebuf, (StringPtr)ebuf);
8282
ebuf += strlen(ebuf);
8383
#else

Mac/Compat/opendir.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DIR *
2020
opendir(path)
2121
char *path;
2222
{
23-
#ifdef TARGET_API_MAC_CARBON
23+
#if TARGET_API_MAC_CARBON
2424
Str255 ppath;
2525
FSSpec fss;
2626
int plen;
@@ -80,7 +80,7 @@ void
8080
closedir(dirp)
8181
DIR *dirp;
8282
{
83-
#ifdef TARGET_API_MAC_CARBON
83+
#if TARGET_API_MAC_CARBON
8484
dirp->nextfile = 0;
8585
#else
8686
WDPBRec pb;
@@ -110,7 +110,7 @@ readdir(dp)
110110

111111
dir.d_name[0]= 0;
112112
pb.d.ioNamePtr= (unsigned char *)dir.d_name;
113-
#ifdef TARGET_API_MAC_CARBON
113+
#if TARGET_API_MAC_CARBON
114114
pb.d.ioVRefNum= dp->vrefnum;
115115
pb.d.ioDrDirID= dp->dirid;
116116
#else
@@ -123,7 +123,7 @@ readdir(dp)
123123
errno = EIO;
124124
return NULL;
125125
}
126-
#ifdef TARGET_API_MAC_CARBON
126+
#if TARGET_API_MAC_CARBON
127127
p2cstrcpy(dir.d_name, (StringPtr)dir.d_name);
128128
#else
129129
(void) p2cstr((unsigned char *)dir.d_name);

Mac/Include/macglue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int PyMac_FindCodeResourceModule(PyStringObject *, char *, char *); /* Test for
9292
PyObject * PyMac_LoadCodeResourceModule(char *, char *); /* Load 'PYD ' resource from file */
9393
struct filedescr *PyMac_FindModuleExtension(char *, size_t *, char *); /* Look for module in single folder */
9494

95-
#ifndef TARGET_API_MAC_CARBON
95+
#if !TARGET_API_MAC_CARBON
9696
int PyMac_GetDirectory(FSSpec *dirfss, char *prompt); /* Ask user for a directory */
9797
void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList,
9898
StandardFileReply *reply, char *prompt); /* Ask user for file, with prompt */

Mac/Modules/Nav.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ navrr_getattr(self, name)
350350
PyErr_Mac(ErrorObject, err);
351351
return NULL;
352352
}
353-
#ifdef TARGET_API_MAC_CARBON
353+
#if TARGET_API_MAC_CARBON
354354
if (err=AEGetDescData(&desc, &fss, sizeof(FSSpec))) {
355355
Py_DECREF(rv);
356356
PyErr_Mac(ErrorObject, err);

Mac/Modules/ae/AEmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ static PyObject *AEDesc_getattr(self, name)
761761
return PyMac_BuildOSType(self->ob_itself.descriptorType);
762762
if (strcmp(name, "data") == 0) {
763763
PyObject *res;
764-
#ifndef TARGET_API_MAC_CARBON
764+
#if !TARGET_API_MAC_CARBON
765765
char state;
766766
state = HGetState(self->ob_itself.dataHandle);
767767
HLock(self->ob_itself.dataHandle);

Mac/Modules/ae/aesupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def outputGetattrHook(self):
178178
return PyMac_BuildOSType(self->ob_itself.descriptorType);
179179
if (strcmp(name, "data") == 0) {
180180
PyObject *res;
181-
#ifndef TARGET_API_MAC_CARBON
181+
#if !TARGET_API_MAC_CARBON
182182
char state;
183183
state = HGetState(self->ob_itself.dataHandle);
184184
HLock(self->ob_itself.dataHandle);

Mac/Modules/cm/Cmmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static PyObject *CmpInstObj_SetComponentInstanceStorage(_self, _args)
160160
return _res;
161161
}
162162

163-
#ifndef TARGET_API_MAC_CARBON
163+
#if !TARGET_API_MAC_CARBON
164164

165165
static PyObject *CmpInstObj_GetComponentInstanceA5(_self, _args)
166166
ComponentInstanceObject *_self;
@@ -177,7 +177,7 @@ static PyObject *CmpInstObj_GetComponentInstanceA5(_self, _args)
177177
}
178178
#endif
179179

180-
#ifndef TARGET_API_MAC_CARBON
180+
#if !TARGET_API_MAC_CARBON
181181

182182
static PyObject *CmpInstObj_SetComponentInstanceA5(_self, _args)
183183
ComponentInstanceObject *_self;
@@ -256,12 +256,12 @@ static PyMethodDef CmpInstObj_methods[] = {
256256
{"SetComponentInstanceStorage", (PyCFunction)CmpInstObj_SetComponentInstanceStorage, 1,
257257
"(Handle theStorage) -> None"},
258258

259-
#ifndef TARGET_API_MAC_CARBON
259+
#if !TARGET_API_MAC_CARBON
260260
{"GetComponentInstanceA5", (PyCFunction)CmpInstObj_GetComponentInstanceA5, 1,
261261
"() -> (long _rv)"},
262262
#endif
263263

264-
#ifndef TARGET_API_MAC_CARBON
264+
#if !TARGET_API_MAC_CARBON
265265
{"SetComponentInstanceA5", (PyCFunction)CmpInstObj_SetComponentInstanceA5, 1,
266266
"(long theA5) -> None"},
267267
#endif

Mac/Modules/cm/cmscan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def makeblacklistnames(self):
6060

6161
def makegreylist(self):
6262
return [
63-
('#ifndef TARGET_API_MAC_CARBON', [
63+
('#if !TARGET_API_MAC_CARBON', [
6464
'SetComponentInstanceA5',
6565
'GetComponentInstanceA5',
6666
])]

Mac/Modules/ctl/Ctlmodule.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ staticforward PyObject *CtlObj_WhichControl(ControlHandle);
1414

1515
#define as_Control(h) ((ControlHandle)h)
1616
#define as_Resource(ctl) ((Handle)ctl)
17-
#ifdef TARGET_API_MAC_CARBON
17+
#if TARGET_API_MAC_CARBON
1818
#define GetControlRect(ctl, rectp) GetControlBounds(ctl, rectp)
1919
#else
2020
#define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect))
@@ -49,7 +49,7 @@ ControlFontStyle_Convert(v, itself)
4949
/* TrackControl and HandleControlClick callback support */
5050
static PyObject *tracker;
5151
static ControlActionUPP mytracker_upp;
52-
#ifndef TARGET_API_MAC_CARBON_NOTYET
52+
#if !TARGET_API_MAC_CARBON_NOTYET
5353
static ControlUserPaneDrawUPP mydrawproc_upp;
5454
static ControlUserPaneIdleUPP myidleproc_upp;
5555
static ControlUserPaneHitTestUPP myhittestproc_upp;
@@ -58,7 +58,7 @@ static ControlUserPaneTrackingUPP mytrackingproc_upp;
5858

5959
extern int settrackfunc(PyObject *); /* forward */
6060
extern void clrtrackfunc(void); /* forward */
61-
#ifndef TARGET_API_MAC_CARBON_NOTYET
61+
#if !TARGET_API_MAC_CARBON_NOTYET
6262
staticforward int setcallback(PyObject *, OSType, PyObject *, UniversalProcPtr *);
6363
#endif
6464

@@ -780,7 +780,7 @@ static PyObject *CtlObj_GetControlReference(_self, _args)
780780
return _res;
781781
}
782782

783-
#ifndef TARGET_API_MAC_CARBON
783+
#if !TARGET_API_MAC_CARBON
784784

785785
static PyObject *CtlObj_GetAuxiliaryControlRecord(_self, _args)
786786
ControlObject *_self;
@@ -800,7 +800,7 @@ static PyObject *CtlObj_GetAuxiliaryControlRecord(_self, _args)
800800
}
801801
#endif
802802

803-
#ifndef TARGET_API_MAC_CARBON
803+
#if !TARGET_API_MAC_CARBON
804804

805805
static PyObject *CtlObj_SetControlColor(_self, _args)
806806
ControlObject *_self;
@@ -819,7 +819,7 @@ static PyObject *CtlObj_SetControlColor(_self, _args)
819819
}
820820
#endif
821821

822-
#ifndef TARGET_API_MAC_CARBON
822+
#if !TARGET_API_MAC_CARBON
823823

824824
static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args)
825825
ControlObject *_self;
@@ -839,7 +839,7 @@ static PyObject *CtlObj_GetBevelButtonMenuValue(_self, _args)
839839
}
840840
#endif
841841

842-
#ifndef TARGET_API_MAC_CARBON
842+
#if !TARGET_API_MAC_CARBON
843843

844844
static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args)
845845
ControlObject *_self;
@@ -860,7 +860,7 @@ static PyObject *CtlObj_SetBevelButtonMenuValue(_self, _args)
860860
}
861861
#endif
862862

863-
#ifndef TARGET_API_MAC_CARBON
863+
#if !TARGET_API_MAC_CARBON
864864

865865
static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args)
866866
ControlObject *_self;
@@ -880,7 +880,7 @@ static PyObject *CtlObj_GetBevelButtonMenuHandle(_self, _args)
880880
}
881881
#endif
882882

883-
#ifndef TARGET_API_MAC_CARBON
883+
#if !TARGET_API_MAC_CARBON
884884

885885
static PyObject *CtlObj_SetBevelButtonTransform(_self, _args)
886886
ControlObject *_self;
@@ -901,7 +901,7 @@ static PyObject *CtlObj_SetBevelButtonTransform(_self, _args)
901901
}
902902
#endif
903903

904-
#ifndef TARGET_API_MAC_CARBON
904+
#if !TARGET_API_MAC_CARBON
905905

906906
static PyObject *CtlObj_SetImageWellTransform(_self, _args)
907907
ControlObject *_self;
@@ -922,7 +922,7 @@ static PyObject *CtlObj_SetImageWellTransform(_self, _args)
922922
}
923923
#endif
924924

925-
#ifndef TARGET_API_MAC_CARBON
925+
#if !TARGET_API_MAC_CARBON
926926

927927
static PyObject *CtlObj_GetTabContentRect(_self, _args)
928928
ControlObject *_self;
@@ -942,7 +942,7 @@ static PyObject *CtlObj_GetTabContentRect(_self, _args)
942942
}
943943
#endif
944944

945-
#ifndef TARGET_API_MAC_CARBON
945+
#if !TARGET_API_MAC_CARBON
946946

947947
static PyObject *CtlObj_SetTabEnabled(_self, _args)
948948
ControlObject *_self;
@@ -966,7 +966,7 @@ static PyObject *CtlObj_SetTabEnabled(_self, _args)
966966
}
967967
#endif
968968

969-
#ifndef TARGET_API_MAC_CARBON
969+
#if !TARGET_API_MAC_CARBON
970970

971971
static PyObject *CtlObj_SetDisclosureTriangleLastValue(_self, _args)
972972
ControlObject *_self;
@@ -1421,7 +1421,7 @@ static PyObject *CtlObj_GetControlDataHandle(_self, _args)
14211421

14221422
}
14231423

1424-
#ifndef TARGET_API_MAC_CARBON_NOTYET
1424+
#if !TARGET_API_MAC_CARBON_NOTYET
14251425

14261426
static PyObject *CtlObj_SetControlDataCallback(_self, _args)
14271427
ControlObject *_self;
@@ -1457,7 +1457,7 @@ static PyObject *CtlObj_SetControlDataCallback(_self, _args)
14571457
}
14581458
#endif
14591459

1460-
#ifndef TARGET_API_MAC_CARBON_NOTYET
1460+
#if !TARGET_API_MAC_CARBON_NOTYET
14611461

14621462
static PyObject *CtlObj_GetPopupData(_self, _args)
14631463
ControlObject *_self;
@@ -1480,7 +1480,7 @@ static PyObject *CtlObj_GetPopupData(_self, _args)
14801480
}
14811481
#endif
14821482

1483-
#ifndef TARGET_API_MAC_CARBON_NOTYET
1483+
#if !TARGET_API_MAC_CARBON_NOTYET
14841484

14851485
static PyObject *CtlObj_SetPopupData(_self, _args)
14861486
ControlObject *_self;
@@ -1591,52 +1591,52 @@ static PyMethodDef CtlObj_methods[] = {
15911591
{"GetControlReference", (PyCFunction)CtlObj_GetControlReference, 1,
15921592
"() -> (SInt32 _rv)"},
15931593

1594-
#ifndef TARGET_API_MAC_CARBON
1594+
#if !TARGET_API_MAC_CARBON
15951595
{"GetAuxiliaryControlRecord", (PyCFunction)CtlObj_GetAuxiliaryControlRecord, 1,
15961596
"() -> (Boolean _rv, AuxCtlHandle acHndl)"},
15971597
#endif
15981598

1599-
#ifndef TARGET_API_MAC_CARBON
1599+
#if !TARGET_API_MAC_CARBON
16001600
{"SetControlColor", (PyCFunction)CtlObj_SetControlColor, 1,
16011601
"(CCTabHandle newColorTable) -> None"},
16021602
#endif
16031603

1604-
#ifndef TARGET_API_MAC_CARBON
1604+
#if !TARGET_API_MAC_CARBON
16051605
{"GetBevelButtonMenuValue", (PyCFunction)CtlObj_GetBevelButtonMenuValue, 1,
16061606
"() -> (SInt16 outValue)"},
16071607
#endif
16081608

1609-
#ifndef TARGET_API_MAC_CARBON
1609+
#if !TARGET_API_MAC_CARBON
16101610
{"SetBevelButtonMenuValue", (PyCFunction)CtlObj_SetBevelButtonMenuValue, 1,
16111611
"(SInt16 inValue) -> None"},
16121612
#endif
16131613

1614-
#ifndef TARGET_API_MAC_CARBON
1614+
#if !TARGET_API_MAC_CARBON
16151615
{"GetBevelButtonMenuHandle", (PyCFunction)CtlObj_GetBevelButtonMenuHandle, 1,
16161616
"() -> (MenuHandle outHandle)"},
16171617
#endif
16181618

1619-
#ifndef TARGET_API_MAC_CARBON
1619+
#if !TARGET_API_MAC_CARBON
16201620
{"SetBevelButtonTransform", (PyCFunction)CtlObj_SetBevelButtonTransform, 1,
16211621
"(IconTransformType transform) -> None"},
16221622
#endif
16231623

1624-
#ifndef TARGET_API_MAC_CARBON
1624+
#if !TARGET_API_MAC_CARBON
16251625
{"SetImageWellTransform", (PyCFunction)CtlObj_SetImageWellTransform, 1,
16261626
"(IconTransformType inTransform) -> None"},
16271627
#endif
16281628

1629-
#ifndef TARGET_API_MAC_CARBON
1629+
#if !TARGET_API_MAC_CARBON
16301630
{"GetTabContentRect", (PyCFunction)CtlObj_GetTabContentRect, 1,
16311631
"() -> (Rect outContentRect)"},
16321632
#endif
16331633

1634-
#ifndef TARGET_API_MAC_CARBON
1634+
#if !TARGET_API_MAC_CARBON
16351635
{"SetTabEnabled", (PyCFunction)CtlObj_SetTabEnabled, 1,
16361636
"(SInt16 inTabToHilite, Boolean inEnabled) -> None"},
16371637
#endif
16381638

1639-
#ifndef TARGET_API_MAC_CARBON
1639+
#if !TARGET_API_MAC_CARBON
16401640
{"SetDisclosureTriangleLastValue", (PyCFunction)CtlObj_SetDisclosureTriangleLastValue, 1,
16411641
"(SInt16 inValue) -> None"},
16421642
#endif
@@ -1677,17 +1677,17 @@ static PyMethodDef CtlObj_methods[] = {
16771677
{"GetControlDataHandle", (PyCFunction)CtlObj_GetControlDataHandle, 1,
16781678
"(part, type) -> ResObj"},
16791679

1680-
#ifndef TARGET_API_MAC_CARBON_NOTYET
1680+
#if !TARGET_API_MAC_CARBON_NOTYET
16811681
{"SetControlDataCallback", (PyCFunction)CtlObj_SetControlDataCallback, 1,
16821682
"(callbackfunc) -> None"},
16831683
#endif
16841684

1685-
#ifndef TARGET_API_MAC_CARBON_NOTYET
1685+
#if !TARGET_API_MAC_CARBON_NOTYET
16861686
{"GetPopupData", (PyCFunction)CtlObj_GetPopupData, 1,
16871687
NULL},
16881688
#endif
16891689

1690-
#ifndef TARGET_API_MAC_CARBON_NOTYET
1690+
#if !TARGET_API_MAC_CARBON_NOTYET
16911691
{"SetPopupData", (PyCFunction)CtlObj_SetPopupData, 1,
16921692
NULL},
16931693
#endif
@@ -2179,7 +2179,7 @@ mytracker(ControlHandle ctl, short part)
21792179
PySys_WriteStderr("TrackControl or HandleControlClick: exception in tracker function\n");
21802180
}
21812181

2182-
#ifndef TARGET_API_MAC_CARBON_NOTYET
2182+
#if !TARGET_API_MAC_CARBON_NOTYET
21832183
static int
21842184
setcallback(myself, which, callback, uppp)
21852185
PyObject *myself;
@@ -2307,7 +2307,7 @@ void initCtl()
23072307

23082308

23092309
mytracker_upp = NewControlActionProc(mytracker);
2310-
#ifndef TARGET_API_MAC_CARBON_NOTYET
2310+
#if !TARGET_API_MAC_CARBON_NOTYET
23112311
mydrawproc_upp = NewControlUserPaneDrawProc(mydrawproc);
23122312
myidleproc_upp = NewControlUserPaneIdleProc(myidleproc);
23132313
myhittestproc_upp = NewControlUserPaneHitTestProc(myhittestproc);

Mac/Modules/ctl/ctlscan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def makeblacklistnames(self):
8181

8282
def makegreylist(self):
8383
return [
84-
('#ifndef TARGET_API_MAC_CARBON', [
84+
('#if !TARGET_API_MAC_CARBON', [
8585
'GetAuxiliaryControlRecord',
8686
'SetControlColor',
8787
# These have suddenly disappeared in UH 3.3.2...

0 commit comments

Comments
 (0)