mirror of
https://github.com/reactos/reactos.git
synced 2025-03-01 03:45:16 +00:00
[UCRTBASE] Add ucrtbase.dll to build
This commit is contained in:
parent
9f15d9ee57
commit
41ffe7f3c6
6 changed files with 2789 additions and 2 deletions
|
@ -212,6 +212,7 @@ add_subdirectory(traffic)
|
||||||
add_subdirectory(twain_32)
|
add_subdirectory(twain_32)
|
||||||
add_subdirectory(ubtrfs)
|
add_subdirectory(ubtrfs)
|
||||||
add_subdirectory(ucdfs)
|
add_subdirectory(ucdfs)
|
||||||
|
add_subdirectory(ucrtbase)
|
||||||
add_subdirectory(uext2)
|
add_subdirectory(uext2)
|
||||||
add_subdirectory(ufat)
|
add_subdirectory(ufat)
|
||||||
add_subdirectory(ufatx)
|
add_subdirectory(ufatx)
|
||||||
|
|
36
dll/win32/ucrtbase/CMakeLists.txt
Normal file
36
dll/win32/ucrtbase/CMakeLists.txt
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
spec2def(ucrtbase.dll ucrtbase.spec ADD_IMPORTLIB)
|
||||||
|
|
||||||
|
add_library(ucrtbase SHARED
|
||||||
|
stubs.c
|
||||||
|
ucrtbase_stubs.c
|
||||||
|
ucrtbase.def
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
target_compile_options(ucrtbase PRIVATE -Wno-builtin-declaration-mismatch)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
# Silence warnings in ucrtbase_stubs.c
|
||||||
|
target_compile_options(ucrtbase PRIVATE -Wno-incompatible-library-redeclaration)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_entrypoint(ucrtbase __acrt_DllMain 12)
|
||||||
|
|
||||||
|
target_link_libraries(ucrtbase
|
||||||
|
ucrt
|
||||||
|
ucrtsupport
|
||||||
|
wine
|
||||||
|
)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
target_link_libraries(ucrtbase runtmchk)
|
||||||
|
else()
|
||||||
|
# For __cxa_guard_acquire / __cxa_guard_release
|
||||||
|
target_link_libraries(ucrtbase libsupc++)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_importlibs(ucrtbase kernel32 ntdll)
|
||||||
|
|
||||||
|
add_cd_file(TARGET ucrtbase DESTINATION reactos/system32 FOR all)
|
83
dll/win32/ucrtbase/stubs.c
Normal file
83
dll/win32/ucrtbase/stubs.c
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <intrin.h>
|
||||||
|
|
||||||
|
// atexit is needed by libsupc++
|
||||||
|
extern int __cdecl _crt_atexit(void (__cdecl*)(void));
|
||||||
|
int __cdecl atexit(void (__cdecl* function)(void))
|
||||||
|
{
|
||||||
|
return _crt_atexit(function);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* __cdecl malloc(size_t);
|
||||||
|
void* __cdecl operator_new(size_t size)
|
||||||
|
{
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void free(void*);
|
||||||
|
void _cdecl operator_delete(void *mem)
|
||||||
|
{
|
||||||
|
free(mem);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _M_IX86
|
||||||
|
void _chkesp_failed(void)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int __cdecl __acrt_initialize_sse2(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The following stubs cannot be implemented as stubs by spec2def, because they are intrinsics
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4163) // not available as an intrinsic function
|
||||||
|
#pragma warning(disable:4164) // intrinsic function not declared
|
||||||
|
#pragma function(fma)
|
||||||
|
#pragma function(fmaf)
|
||||||
|
#pragma function(log2)
|
||||||
|
#pragma function(log2f)
|
||||||
|
#pragma function(lrint)
|
||||||
|
#pragma function(lrintf)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
double fma(double x, double y, double z)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
return 0.;
|
||||||
|
}
|
||||||
|
|
||||||
|
float fmaf(float x, float y, float z)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
return 0.;
|
||||||
|
}
|
||||||
|
|
||||||
|
double log2(double x)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
return 0.;
|
||||||
|
}
|
||||||
|
|
||||||
|
float log2f(float x)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
return 0.;
|
||||||
|
}
|
||||||
|
|
||||||
|
long int lrint(double x)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
long int lrintf(float x)
|
||||||
|
{
|
||||||
|
__debugbreak();
|
||||||
|
return 0;
|
||||||
|
}
|
2667
dll/win32/ucrtbase/ucrtbase.spec
Normal file
2667
dll/win32/ucrtbase/ucrtbase.spec
Normal file
File diff suppressed because it is too large
Load diff
|
@ -20,7 +20,7 @@ list(APPEND UCRT_HEAP_SOURCES
|
||||||
heap/recalloc.cpp
|
heap/recalloc.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(DBG)
|
||||||
list(APPEND UCRT_HEAP_SOURCES
|
list(APPEND UCRT_HEAP_SOURCES
|
||||||
heap/debug_heap.cpp
|
heap/debug_heap.cpp
|
||||||
heap/debug_heap_hook.cpp
|
heap/debug_heap_hook.cpp
|
||||||
|
|
|
@ -25,7 +25,7 @@ list(APPEND UCRT_MISC_SOURCES
|
||||||
misc/_strerr.cpp
|
misc/_strerr.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(DBG)
|
||||||
list(APPEND UCRT_MISC_SOURCES
|
list(APPEND UCRT_MISC_SOURCES
|
||||||
misc/dbgrpt.cpp
|
misc/dbgrpt.cpp
|
||||||
misc/dbgrptt.cpp
|
misc/dbgrptt.cpp
|
||||||
|
|
Loading…
Reference in a new issue