Skip to content

Commit 860dc04

Browse files
committed
Ported to CW5 (or to new Universal Headers, actually)
1 parent 2fc94ee commit 860dc04

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Mac/Unsupported/mactcp/macdnrmodule.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3131
#ifndef __MWERKS__
3232
#define ResultUPP ResultProcPtr
3333
#define NewResultProc(x) (x)
34+
/* The '2' has move in this name... */
35+
#define Result2UPP ResultProc2Ptr
36+
#define NewResult2Proc(x) (x)
3437
#endif
3538

3639
static object *ErrorObject;
@@ -360,14 +363,15 @@ dnr_HInfo(self, args)
360363
OSErr err;
361364
char *hostname;
362365
dnrrobject *rv;
366+
Result2UPP cb_upp = NewResult2Proc(dnrr_done);
363367

364368
if (!newgetargs(args, "s", &hostname))
365369
return NULL;
366370
if ( !opendnr(NULL) )
367371
return NULL;
368372
if ( (rv=newdnrrobject(DNR_HINFO)) == NULL )
369373
return NULL;
370-
err = HInfo(hostname, &rv->hinfo, (ResultProc2Ptr)dnrr_done, (char *)rv);
374+
err = HInfo(hostname, &rv->hinfo, cb_upp, (char *)rv);
371375
if ( err == cacheFault ) {
372376
rv->waiting++;
373377
INCREF(rv);
@@ -392,14 +396,15 @@ dnr_MXInfo(self, args)
392396
OSErr err;
393397
char *hostname;
394398
dnrrobject *rv;
399+
Result2UPP cb_upp = NewResult2Proc(dnrr_done);
395400

396401
if (!newgetargs(args, "s", &hostname))
397402
return NULL;
398403
if ( !opendnr(NULL) )
399404
return NULL;
400405
if ( (rv=newdnrrobject(DNR_MX)) == NULL )
401406
return NULL;
402-
err = MXInfo(hostname, &rv->hinfo, (ResultProc2Ptr)dnrr_done, (char *)rv);
407+
err = MXInfo(hostname, &rv->hinfo, cb_upp, (char *)rv);
403408
if ( err == cacheFault ) {
404409
rv->waiting++;
405410
INCREF(rv);

Mac/Unsupported/mactcp/mactcpmodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3636
#define STATE_ESTAB 8
3737
#define STATE_CWAIT 18
3838

39+
/* Python code has an additional reason for asr call: open done */
40+
#define MY_OPEN_DONE 32766
41+
3942
static object *ErrorObject;
4043

4144
TCPIOCompletionUPP upp_tcp_done;
@@ -334,7 +337,7 @@ tcps_done(pb)
334337
/* Extension of mactcp semantics: also call asr on open complete */
335338
if ( self->asr == None )
336339
return;
337-
self->asr_ec = lastEvent-1;
340+
self->asr_ec = MY_OPEN_DONE;
338341
self->asr_reason = 0;
339342
Py_AddPendingCall(tcps_asr_safe, (void *)self);
340343
}

0 commit comments

Comments
 (0)