FL_STUB = 2,
FL_NONAME = 4,
FL_ORDINAL = 8,
+ FL_DATA_ALIAS = 16
};
enum
}
else
{
+ /* Does the string already have stdcall decoration? */
+ pcAt = ScanToken(pcName, '@');
+ if (pcAt && (pcAt < (pcName + nNameLength)) && pcName[0] == '_')
+ {
+ /* Skip leading underscore and remove trailing decoration */
+ pcName++;
+ nNameLength = pcAt - pcName;
+ }
+
/* Print the undecorated function name */
fprintf(fileDest, "%.*s", nNameLength, pcName);
}
fprintf(fileDest, " PRIVATE");
}
- if (pexp->nCallingConvention == CC_EXTERN)
+ /* Make this a data export, unless this is MSVC and -withalias was given */
+ if ((pexp->nCallingConvention == CC_EXTERN) &&
+ !(gbMSComp && (pexp->uFlags & FL_DATA_ALIAS)))
{
fprintf(fileDest, " DATA");
}
{
exp.uFlags |= FL_STUB;
}
+ else if (CompareToken(pc, "-withalias"))
+ {
+ /* This flag is to create a nin _imp_ prefixed alias for a
+ data export, so that the hacked DDK declarations work */
+ if (exp.nCallingConvention != CC_EXTERN)
+ fprintf(stderr, "error: line %d -withalias on non-data export\n", nLine);
+ else
+ exp.uFlags |= FL_DATA_ALIAS;
+ }
else if (CompareToken(pc, "-norelay") ||
CompareToken(pc, "-register") ||
CompareToken(pc, "-ret64"))