- Allow to allow wchar_t even on C++, if it is not GCC
- Remove a number of duplicate definitions
[FRAMEDYN]
- Compile with /Zc:wchar_t- on MSVC
- Get rid of now obsolete MSVC symbol aliases
- Share the spec file
- Add 2 GCC symbols in the export lib (C2 constructor, D2 destructor), which are in this case identical to C1 and D1

svn path=/trunk/; revision=64423
This commit is contained in:
Timo Kreuzer 2014-09-30 20:48:54 +00:00
parent e0fc18bcf3
commit 784409d6e2
9 changed files with 10 additions and 206 deletions

View file

@ -1,11 +1,7 @@
set_cpp(WITH_RUNTIME WITH_EXCEPTIONS)
if(NOT MSVC)
spec2def(framedyn.dll framedyn_gcc.spec ADD_IMPORTLIB)
else()
spec2def(framedyn.dll framedyn_msvc.spec ADD_IMPORTLIB)
endif()
spec2def(framedyn.dll framedyn.spec ADD_IMPORTLIB)
list(APPEND SOURCE
main.c
@ -13,18 +9,16 @@ list(APPEND SOURCE
${CMAKE_CURRENT_BINARY_DIR}/framedyn.def)
if(MSVC)
add_asm_files(framedyn_asm fix_exports_msvc.s)
add_compile_flags("/Zc:wchar_t-")
endif()
add_library(framedyn SHARED ${SOURCE} ${framedyn_asm})
add_library(framedyn SHARED ${SOURCE})
set_module_type(framedyn win32dll UNICODE)
add_importlibs(framedyn oleaut32 msvcrt kernel32 ntdll)
add_cd_file(TARGET framedyn DESTINATION reactos/system32/wbem FOR all)
if(MSVC)
add_asm_files(framedynex_asm alias_msvc.s)
else()
if(NOT MSVC)
add_asm_files(framedynex_asm alias_gcc.s)
endif()
add_library(framedynex ${framedynex_asm})

View file

@ -24,6 +24,7 @@ DEFINE_ALIAS(__ZN8CHStringC1EPKw, ??0CHString@@QAE@PBG@Z)
DEFINE_ALIAS(__ZN8CHStringC1EPKwi, ??0CHString@@QAE@PBGH@Z)
DEFINE_ALIAS(__ZN8CHStringC1Ewi, ??0CHString@@QAE@GH@Z)
DEFINE_ALIAS(__ZN8CHStringC1Ev, ??0CHString@@QAE@XZ)
DEFINE_ALIAS(__ZN8CHStringC2Ev, ??0CHString@@QAE@XZ) // CHString::CHString(void)
DEFINE_ALIAS(__ZNK8CHString7CollateEPKw, ?Collate@CHString@@QBEHPBG@Z)
DEFINE_ALIAS(__ZNK8CHString7CompareEPKw, ?Compare@CHString@@QBEHPBG@Z)
DEFINE_ALIAS(__ZNK8CHString13CompareNoCaseEPKw, ?CompareNoCase@CHString@@QBEHPBG@Z)
@ -62,7 +63,7 @@ DEFINE_ALIAS(__ZN8CHString7ReleaseEv, ?Release@CHString@@IAEXXZ)
DEFINE_ALIAS(__ZN8CHString13ReleaseBufferEi, ?ReleaseBuffer@CHString@@QAEXH@Z)
DEFINE_ALIAS(__ZNK8CHString11ReverseFindEw, ?ReverseFind@CHString@@QBEHG@Z)
DEFINE_ALIAS(__ZNK8CHString5RightEi, ?Right@CHString@@QBE?AV1@H@Z)
DEFINE_ALIAS(__ZN8CHString10SafeStrlenEPKw, ?SafeStrlen@CHString@@KGHPBG@Z)
DEFINE_ALIAS(__ZN8CHString10SafeStrlenEPKw@4, ?SafeStrlen@CHString@@KGHPBG@Z)
DEFINE_ALIAS(__ZN8CHString5SetAtEiw, ?SetAt@CHString@@QAEXHG@Z)
DEFINE_ALIAS(__ZNK8CHString13SpanExcludingEPKw, ?SpanExcluding@CHString@@QBE?AV1@PBG@Z)
DEFINE_ALIAS(__ZNK8CHString13SpanIncludingEPKw, ?SpanIncluding@CHString@@QBE?AV1@PBG@Z)
@ -82,7 +83,8 @@ DEFINE_ALIAS(__ZN8CHStringaSEPKh, ??4CHString@@QAEABV0@PBE@Z)
DEFINE_ALIAS(__ZN8CHStringaSEPKw, ??4CHString@@QAEABV0@PBG@Z)
DEFINE_ALIAS(__ZN8CHStringaSEw, ??4CHString@@QAEABV0@G@Z)
DEFINE_ALIAS(__ZNK8CHStringixEi, ??ACHString@@QBEGH@Z)
DEFINE_ALIAS(__ZN8CHStringD1Ev, ??1CHString@@QAE@XZ)
DEFINE_ALIAS(__ZN8CHStringD1Ev, ??1CHString@@QAE@XZ) // CHString::~CHString() complete object destructor
DEFINE_ALIAS(__ZN8CHStringD2Ev, ??1CHString@@QAE@XZ) // CHString::~CHString() base object destructor
DEFINE_ALIAS(__ZplwRK8CHString, ??H@YG?AVCHString@@GABV0@@Z)
DEFINE_ALIAS(__ZplRK8CHStringw, ??H@YG?AVCHString@@ABV0@G@Z)
DEFINE_ALIAS(__ZplRK8CHStringPKw, ??H@YG?AVCHString@@ABV0@PBG@Z)

View file

@ -1,48 +0,0 @@
#include <asm.inc>
.code64
.align 4
MACRO(DEFINE_ALIAS, alias, orig)
EXTERN &orig:ABS
ALIAS <&alias> = <&orig>
ENDM
DEFINE_ALIAS ?AllocSysString@CHString@@QBEPA_WXZ, ?AllocSysString@CHString@@QBEPAGXZ
DEFINE_ALIAS ?AssignCopy@CHString@@IAEXHPB_W@Z, ?AssignCopy@CHString@@IAEXHPBG@Z
DEFINE_ALIAS ??0CHString@@QAE@PB_W@Z, ??0CHString@@QAE@PBG@Z
DEFINE_ALIAS ??0CHString@@QAE@PB_WH@Z, ??0CHString@@QAE@PBGH@Z
DEFINE_ALIAS ??0CHString@@QAE@_WH@Z, ??0CHString@@QAE@GH@Z
DEFINE_ALIAS ?Collate@CHString@@QBEHPB_W@Z, ?Collate@CHString@@QBEHPBG@Z
DEFINE_ALIAS ?Compare@CHString@@QBEHPB_W@Z, ?Compare@CHString@@QBEHPBG@Z
DEFINE_ALIAS ?CompareNoCase@CHString@@QBEHPB_W@Z, ?CompareNoCase@CHString@@QBEHPBG@Z
DEFINE_ALIAS ?ConcatCopy@CHString@@IAEXHPB_WH0@Z, ?ConcatCopy@CHString@@IAEXHPBGH0@Z
DEFINE_ALIAS ?ConcatInPlace@CHString@@IAEXHPB_W@Z, ?ConcatInPlace@CHString@@IAEXHPBG@Z
DEFINE_ALIAS ?Find@CHString@@QBEHPB_W@Z, ?Find@CHString@@QBEHPBG@Z
DEFINE_ALIAS ?Find@CHString@@QBEH_W@Z, ?Find@CHString@@QBEHG@Z
DEFINE_ALIAS ?FindOneOf@CHString@@QBEHPB_W@Z, ?FindOneOf@CHString@@QBEHPBG@Z
DEFINE_ALIAS ?Format@CHString@@QAAXPB_WZZ, ?Format@CHString@@QAAXPBGZZ
DEFINE_ALIAS ?FormatMessageW@CHString@@QAAXPB_WZZ, ?FormatMessageW@CHString@@QAAXPBGZZ
DEFINE_ALIAS ?FormatV@CHString@@QAEXPB_WPAD@Z, ?FormatV@CHString@@QAEXPBGPAD@Z
DEFINE_ALIAS ?GetAt@CHString@@QBE_WH@Z, ?GetAt@CHString@@QBEGH@Z
DEFINE_ALIAS ?GetBuffer@CHString@@QAEPA_WH@Z, ?GetBuffer@CHString@@QAEPAGH@Z
DEFINE_ALIAS ?GetBufferSetLength@CHString@@QAEPA_WH@Z, ?GetBufferSetLength@CHString@@QAEPAGH@Z
DEFINE_ALIAS ?LoadStringW@CHString@@IAEHIPA_WI@Z, ?LoadStringW@CHString@@IAEHIPAGI@Z
DEFINE_ALIAS ?LockBuffer@CHString@@QAEPA_WXZ, ?LockBuffer@CHString@@QAEPAGXZ
DEFINE_ALIAS ?ReverseFind@CHString@@QBEH_W@Z, ?ReverseFind@CHString@@QBEHG@Z
DEFINE_ALIAS ?SafeStrlen@CHString@@KGHPB_W@Z, ?SafeStrlen@CHString@@KGHPBG@Z
DEFINE_ALIAS ?SetAt@CHString@@QAEXH_W@Z, ?SetAt@CHString@@QAEXHG@Z
DEFINE_ALIAS ?SpanExcluding@CHString@@QBE?AV1@PB_W@Z, ?SpanExcluding@CHString@@QBE?AV1@PBG@Z
DEFINE_ALIAS ?SpanIncluding@CHString@@QBE?AV1@PB_W@Z, ?SpanIncluding@CHString@@QBE?AV1@PBG@Z
DEFINE_ALIAS ??BCHString@@QBEPB_WXZ, ??BCHString@@QBEPBGXZ
DEFINE_ALIAS ??YCHString@@QAEABV0@PB_W@Z, ??YCHString@@QAEABV0@PBG@Z
DEFINE_ALIAS ??YCHString@@QAEABV0@_W@Z, ??YCHString@@QAEABV0@G@Z
DEFINE_ALIAS ??4CHString@@QAEABV0@PB_W@Z, ??4CHString@@QAEABV0@PBG@Z
DEFINE_ALIAS ??4CHString@@QAEABV0@_W@Z, ??4CHString@@QAEABV0@G@Z
DEFINE_ALIAS ??ACHString@@QBE_WH@Z, ??ACHString@@QBEGH@Z
DEFINE_ALIAS ??H@YG?AVCHString@@_WABV0@@Z, ??H@YG?AVCHString@@GABV0@@Z
DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@_W@Z, ??H@YG?AVCHString@@ABV0@G@Z
DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@PB_W@Z, ??H@YG?AVCHString@@ABV0@PBG@Z
DEFINE_ALIAS ??H@YG?AVCHString@@PB_WABV0@@Z, ??H@YG?AVCHString@@PBGABV0@@Z
END

View file

@ -1,48 +0,0 @@
#include <asm.inc>
.code64
.align 4
MACRO(DEFINE_ALIAS, alias, orig)
EXTERN &orig:ABS
ALIAS <&alias> = <&orig>
ENDM
DEFINE_ALIAS ?AllocSysString@CHString@@QBEPAGXZ, ?AllocSysString@CHString@@QBEPA_WXZ
DEFINE_ALIAS ?AssignCopy@CHString@@IAEXHPBG@Z, ?AssignCopy@CHString@@IAEXHPB_W@Z
DEFINE_ALIAS ??0CHString@@QAE@PBG@Z, ??0CHString@@QAE@PB_W@Z
DEFINE_ALIAS ??0CHString@@QAE@PBGH@Z, ??0CHString@@QAE@PB_WH@Z
DEFINE_ALIAS ??0CHString@@QAE@GH@Z, ??0CHString@@QAE@_WH@Z
DEFINE_ALIAS ?Collate@CHString@@QBEHPBG@Z, ?Collate@CHString@@QBEHPB_W@Z
DEFINE_ALIAS ?Compare@CHString@@QBEHPBG@Z, ?Compare@CHString@@QBEHPB_W@Z
DEFINE_ALIAS ?CompareNoCase@CHString@@QBEHPBG@Z, ?CompareNoCase@CHString@@QBEHPB_W@Z
DEFINE_ALIAS ?ConcatCopy@CHString@@IAEXHPBGH0@Z, ?ConcatCopy@CHString@@IAEXHPB_WH0@Z
DEFINE_ALIAS ?ConcatInPlace@CHString@@IAEXHPBG@Z, ?ConcatInPlace@CHString@@IAEXHPB_W@Z
DEFINE_ALIAS ?Find@CHString@@QBEHPBG@Z, ?Find@CHString@@QBEHPB_W@Z
DEFINE_ALIAS ?Find@CHString@@QBEHG@Z, ?Find@CHString@@QBEH_W@Z
DEFINE_ALIAS ?FindOneOf@CHString@@QBEHPBG@Z, ?FindOneOf@CHString@@QBEHPB_W@Z
DEFINE_ALIAS ?Format@CHString@@QAAXPBGZZ, ?Format@CHString@@QAAXPB_WZZ
DEFINE_ALIAS ?FormatMessageW@CHString@@QAAXPBGZZ, ?FormatMessageW@CHString@@QAAXPB_WZZ
DEFINE_ALIAS ?FormatV@CHString@@QAEXPBGPAD@Z, ?FormatV@CHString@@QAEXPB_WPAD@Z
DEFINE_ALIAS ?GetAt@CHString@@QBEGH@Z, ?GetAt@CHString@@QBE_WH@Z
DEFINE_ALIAS ?GetBuffer@CHString@@QAEPAGH@Z, ?GetBuffer@CHString@@QAEPA_WH@Z
DEFINE_ALIAS ?GetBufferSetLength@CHString@@QAEPAGH@Z, ?GetBufferSetLength@CHString@@QAEPA_WH@Z
DEFINE_ALIAS ?LoadStringW@CHString@@IAEHIPAGI@Z, ?LoadStringW@CHString@@IAEHIPA_WI@Z
DEFINE_ALIAS ?LockBuffer@CHString@@QAEPAGXZ, ?LockBuffer@CHString@@QAEPA_WXZ
DEFINE_ALIAS ?ReverseFind@CHString@@QBEHG@Z, ?ReverseFind@CHString@@QBEH_W@Z
DEFINE_ALIAS ?SafeStrlen@CHString@@KGHPBG@Z, ?SafeStrlen@CHString@@KGHPB_W@Z
DEFINE_ALIAS ?SetAt@CHString@@QAEXHG@Z, ?SetAt@CHString@@QAEXH_W@Z
DEFINE_ALIAS ?SpanExcluding@CHString@@QBE?AV1@PBG@Z, ?SpanExcluding@CHString@@QBE?AV1@PB_W@Z
DEFINE_ALIAS ?SpanIncluding@CHString@@QBE?AV1@PBG@Z, ?SpanIncluding@CHString@@QBE?AV1@PB_W@Z
DEFINE_ALIAS ??BCHString@@QBEPBGXZ, ??BCHString@@QBEPB_WXZ
DEFINE_ALIAS ??YCHString@@QAEABV0@PBG@Z, ??YCHString@@QAEABV0@PB_W@Z
DEFINE_ALIAS ??YCHString@@QAEABV0@G@Z, ??YCHString@@QAEABV0@_W@Z
DEFINE_ALIAS ??4CHString@@QAEABV0@PBG@Z, ??4CHString@@QAEABV0@PB_W@Z
DEFINE_ALIAS ??4CHString@@QAEABV0@G@Z, ??4CHString@@QAEABV0@_W@Z
DEFINE_ALIAS ??ACHString@@QBEGH@Z, ??ACHString@@QBE_WH@Z
DEFINE_ALIAS ??H@YG?AVCHString@@GABV0@@Z, ??H@YG?AVCHString@@_WABV0@@Z
DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@G@Z, ??H@YG?AVCHString@@ABV0@_W@Z
DEFINE_ALIAS ??H@YG?AVCHString@@ABV0@PBG@Z, ??H@YG?AVCHString@@ABV0@PB_W@Z
DEFINE_ALIAS ??H@YG?AVCHString@@PBGABV0@@Z, ??H@YG?AVCHString@@PB_WABV0@@Z
END

View file

@ -68,7 +68,7 @@
@ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr) _ZN8CHStringaSEPKw
@ thiscall ??4CHString@@QAEABV0@G@Z(long) _ZN8CHStringaSEw
@ thiscall ??ACHString@@QBEGH@Z(long) _ZNK8CHStringixEi
@ thiscall ??1CHString@@QAE@XZ() _ZN8CHStringD1Ev
@ thiscall ??1CHString@@QAE@XZ() _ZN8CHStringD1Ev # complete object destructor, identical to _ZN8CHStringD2Ev aka base object destructor
@ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr) _ZplwRK8CHString
@ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long) _ZplRK8CHStringw
@ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr) _ZplRK8CHStringPKw

View file

@ -1,76 +0,0 @@
@ thiscall ?AllocBeforeWrite@CHString@@IAEXH@Z(long)
@ thiscall ?AllocBuffer@CHString@@IAEXH@Z(long)
@ thiscall ?AllocCopy@CHString@@IBEXAAV1@HHH@Z(ptr long long long)
@ thiscall ?AllocSysString@CHString@@QBEPAGXZ()
@ thiscall ?AssignCopy@CHString@@IAEXHPBG@Z(long wstr)
@ thiscall ??0CHString@@QAE@ABV0@@Z(ptr)
@ thiscall ??0CHString@@QAE@PBD@Z(str)
@ thiscall ??0CHString@@QAE@PBE@Z(str)
@ thiscall ??0CHString@@QAE@PBG@Z(wstr)
@ thiscall ??0CHString@@QAE@PBGH@Z(wstr long)
@ thiscall ??0CHString@@QAE@GH@Z(long long)
@ thiscall ??0CHString@@QAE@XZ()
@ thiscall ?Collate@CHString@@QBEHPBG@Z(wstr)
@ thiscall ?Compare@CHString@@QBEHPBG@Z(wstr)
@ thiscall ?CompareNoCase@CHString@@QBEHPBG@Z(wstr)
@ thiscall ?ConcatCopy@CHString@@IAEXHPBGH0@Z(long wstr long wstr)
@ thiscall ?ConcatInPlace@CHString@@IAEXHPBG@Z(long wstr)
@ thiscall ?CopyBeforeWrite@CHString@@IAEXXZ()
@ thiscall ?Empty@CHString@@QAEXXZ()
@ thiscall ?Find@CHString@@QBEHPBG@Z(wstr)
@ thiscall ?Find@CHString@@QBEHG@Z(long)
@ thiscall ?FindOneOf@CHString@@QBEHPBG@Z(wstr)
@ thiscall ?Format@CHString@@QAAXIZZ(long long long)
@ thiscall ?Format@CHString@@QAAXPBGZZ(long wstr long)
@ thiscall ?FormatMessageW@CHString@@QAAXIZZ(long long long)
@ thiscall ?FormatMessageW@CHString@@QAAXPBGZZ(long ptr long)
@ thiscall ?FormatV@CHString@@QAEXPBGPAD@Z(wstr long)
@ thiscall ?FreeExtra@CHString@@QAEXXZ()
@ thiscall ?GetAllocLength@CHString@@QBEHXZ()
@ thiscall ?GetAt@CHString@@QBEGH@Z(long)
@ thiscall ?GetBuffer@CHString@@QAEPAGH@Z(long)
@ thiscall ?GetBufferSetLength@CHString@@QAEPAGH@Z(long)
@ thiscall ?GetData@CHString@@IBEPAUCHStringData@@XZ()
@ thiscall ?GetLength@CHString@@QBEHXZ()
@ thiscall ?Init@CHString@@IAEXXZ()
@ thiscall ?IsEmpty@CHString@@QBEHXZ()
@ thiscall ?Left@CHString@@QBE?AV1@H@Z(long)
@ thiscall ?LoadStringW@CHString@@QAEHI@Z(long)
@ thiscall ?LoadStringW@CHString@@IAEHIPAGI@Z(long wstr long)
@ thiscall ?LockBuffer@CHString@@QAEPAGXZ()
@ thiscall ?MakeLower@CHString@@QAEXXZ()
@ thiscall ?MakeReverse@CHString@@QAEXXZ()
@ thiscall ?MakeUpper@CHString@@QAEXXZ()
@ thiscall ?Mid@CHString@@QBE?AV1@H@Z(long)
@ thiscall ?Mid@CHString@@QBE?AV1@HH@Z(long long)
@ thiscall ?Release@CHString@@KGXPAUCHStringData@@@Z(ptr)
@ thiscall ?Release@CHString@@IAEXXZ()
@ thiscall ?ReleaseBuffer@CHString@@QAEXH@Z(long)
@ thiscall ?ReverseFind@CHString@@QBEHG@Z(long)
@ thiscall ?Right@CHString@@QBE?AV1@H@Z(long)
@ stdcall ?SafeStrlen@CHString@@KGHPBG@Z(wstr)
@ thiscall ?SetAt@CHString@@QAEXHG@Z(long long)
@ thiscall ?SpanExcluding@CHString@@QBE?AV1@PBG@Z(long wstr)
@ thiscall ?SpanIncluding@CHString@@QBE?AV1@PBG@Z(long wstr)
@ thiscall ?TrimLeft@CHString@@QAEXXZ()
@ thiscall ?TrimRight@CHString@@QAEXXZ()
@ thiscall ?UnlockBuffer@CHString@@QAEXXZ()
@ thiscall ??BCHString@@QBEPBGXZ(ptr)
@ thiscall ??YCHString@@QAEABV0@ABV0@@Z(ptr)
@ thiscall ??YCHString@@QAEABV0@D@Z(long)
@ thiscall ??YCHString@@QAEABV0@PBG@Z(wstr)
@ thiscall ??YCHString@@QAEABV0@G@Z(long)
@ thiscall ??4CHString@@QAEABV0@PAV0@@Z(ptr)
@ thiscall ??4CHString@@QAEABV0@ABV0@@Z(ptr)
@ thiscall ??4CHString@@QAEABV0@PBD@Z(str)
@ thiscall ??4CHString@@QAEABV0@D@Z(long)
@ thiscall ??4CHString@@QAEABV0@PBE@Z(str)
@ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr)
@ thiscall ??4CHString@@QAEABV0@G@Z(long)
@ thiscall ??ACHString@@QBEGH@Z(long)
@ thiscall ??1CHString@@QAE@XZ()
@ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr)
@ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long)
@ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr)
@ stdcall ??H@YG?AVCHString@@PBGABV0@@Z(wstr ptr)
@ stdcall ??H@YG?AVCHString@@ABV0@0@Z(ptr ptr)

View file

@ -316,7 +316,7 @@ extern "C" {
#ifndef _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
#ifndef __cplusplus
#if defined(_MSC_VER) || !defined(__cplusplus)
typedef unsigned short wchar_t;
#endif
#endif

View file

@ -23,11 +23,6 @@ extern "C" {
#define _RTC_ERRTYPE_IGNORE -1
#define _RTC_ERRTYPE_ASK -2
#ifndef _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#endif
typedef int (__cdecl *_RTC_error_fn)(int,const char *,int,const char *,const char *,...);
typedef int (__cdecl *_RTC_error_fnW)(int,const wchar_t *,int,const wchar_t *,const wchar_t *,...);

View file

@ -18,21 +18,6 @@
extern "C" {
#endif
#ifndef _CRTIMP
#define _CRTIMP __declspec(dllimport)
#endif
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
#ifndef _WCTYPE_T_DEFINED
typedef unsigned short wint_t;
typedef unsigned short wctype_t;
#define _WCTYPE_T_DEFINED
#endif
#ifndef WEOF
#define WEOF (wint_t)(0xFFFF)
#endif