Fix up (dynaloading) to work properly with multiplicity
p4raw-link: @12820 on //depot/maint-5.6/macperl:
1254e164e862d84b4c35d69c6880819df23c4acd
p4raw-id: //depot/perl@12823
p4raw-integrated: from //depot/maint-5.6/macperl@12818 'merge in'
ext/DynaLoader/dl_mac.xs (@12699..)
#define dl_connections (dl_cxtx.x_connections)
-static void terminate(void)
+static void terminate(pTHX_ void *ptr)
{
- dTHX;
dMY_CXT;
int size = GetHandleSize((Handle) dl_connections) / sizeof(ConnectionID);
HLock((Handle) dl_connections);
dMY_CXT;
if (!dl_connections) {
dl_connections = (ConnectionID **)NewHandle(0);
- atexit(terminate);
+ call_atexit(terminate, (void*)0);
}
PtrAndHand((Ptr) &connID, (Handle) dl_connections, sizeof(ConnectionID));
RETVAL = connID;