Author: tkreuzer
Date: Sat May 10 13:55:09 2014
New Revision: 63217
URL: http://svn.reactos.org/svn/reactos?rev=63217&view=rev
Log:
[SPEC2DEF]
Add support for adding aliases when exporting data by specifying the -withalias switch. This will cause MS LINK to generate _FooVar as an alias alias for _imp__FooVar. While this looks wrong and is not the way you usually handle data imports, this is what we have in the DDK for a number of data exports like KdDebuggerNotPresent, IoFileObjectType, ..., which we currently define in an incompatible way. Remove stdcall decorations on non-x86 builds
Modified:
trunk/reactos/tools/spec2def/spec2def.c
Modified: trunk/reactos/tools/spec2def/spec2def.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
==============================================================================
--- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Sat May 10 13:55:09 2014
@@ -52,6 +52,7 @@
FL_STUB = 2,
FL_NONAME = 4,
FL_ORDINAL = 8,
+ FL_DATA_ALIAS = 16
};
enum
@@ -369,6 +370,15 @@
}
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);
}
@@ -492,7 +502,9 @@
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");
}
@@ -644,6 +656,15 @@
else if (CompareToken(pc, "-stub"))
{
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") ||
Author: tkreuzer
Date: Sat May 10 12:01:17 2014
New Revision: 63216
URL: http://svn.reactos.org/svn/reactos?rev=63216&view=rev
Log:
[CPPRT]
Add an alias for __CxxFrameHandler3 on x64 builds
Modified:
trunk/reactos/lib/sdk/cpprt/amd64/cpprt.s
Modified: trunk/reactos/lib/sdk/cpprt/amd64/cpprt.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/cpprt/amd64/cpprt.…
==============================================================================
--- trunk/reactos/lib/sdk/cpprt/amd64/cpprt.s [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/cpprt/amd64/cpprt.s [iso-8859-1] Sat May 10 12:01:17 2014
@@ -13,4 +13,7 @@
; void __cdecl `eh vector destructor iterator'(void *,unsigned __int64,int,void (__cdecl*)(void *))
DEFINE_ALIAS ??_M@YAXPEAX_KHP6AX0@Z@Z, ?MSVCRTEX_eh_vector_destructor_iterator@@YAXPEAX_KHP6AX0@Z@Z
+; These are the same
+DEFINE_ALIAS __CxxFrameHandler3, __CxxFrameHandler
+
END