stdlib: move all mslibc functions to SDL_mslibc.c

This allows disabling LTO on them by only specifying a single file.
This commit is contained in:
Anonymous Maarten
2022-07-26 21:47:52 +02:00
committed by Sam Lantinga
parent a169259f62
commit 5da85376b9
12 changed files with 829 additions and 894 deletions

View File

@@ -678,7 +678,8 @@ endif()
if(MSVC)
# Due to a limitation of Microsoft's LTO implementation, LTO must be disabled for memcpy and memset.
set_property(SOURCE src/stdlib/SDL_memcpy.c src/stdlib/SDL_memset.c APPEND PROPERTY COMPILE_FLAGS /GL-)
# The same applies to various functions normally belonging in the C library (for x86 architecture).
set_property(SOURCE src/stdlib/SDL_mslibc.c APPEND PROPERTY COMPILE_FLAGS /GL-)
endif()
if(SDL_ASSEMBLY)

View File

@@ -68,7 +68,7 @@ CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_guid.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c SDL_utils.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_memcpy.c SDL_memset.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
SRCS+= SDL_rwops.c SDL_power.c
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c

View File

@@ -44,7 +44,7 @@ CFLAGS_DLL+= -DSDL_BUILD_MICRO_VERSION=$(MICRO_VERSION)
RCFLAGS = -q -r -bt=nt $(INCPATH)
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_guid.c SDL_log.c SDL_dataqueue.c SDL_hints.c SDL_list.c SDL_utils.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_memcpy.c SDL_memset.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c SDL_crc32.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
SRCS+= SDL_rwops.c SDL_power.c
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c

View File

@@ -697,8 +697,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />

View File

@@ -1352,10 +1352,7 @@
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.c">
<Filter>render\direct3d12</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c">
<Filter>stdlib</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_memset.c">
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c">
<Filter>stdlib</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp">

View File

@@ -311,8 +311,7 @@
<ClCompile Include="..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\src\stdlib\SDL_memcpy.c" />
<ClCompile Include="..\src\stdlib\SDL_memset.c" />
<ClCompile Include="..\src\stdlib\SDL_mslibc.c" />
<ClCompile Include="..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\src\stdlib\SDL_string.c" />

View File

@@ -565,8 +565,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
<ClCompile Include="..\..\src\stdlib\SDL_mslibc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />

View File

@@ -3382,24 +3382,6 @@
DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
F3249B1E285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B1F285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B20285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B21285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B22285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B23285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B24285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B25285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B26285A85FF00DB9B5C /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1C285A85FF00DB9B5C /* SDL_memset.c */; };
F3249B27285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B28285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B29285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B2A285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B2B285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B2C285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B2D285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B2E285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3249B2F285A85FF00DB9B5C /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */; };
F3631C6424884ACF004F28EA /* SDL_locale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26792462701100718109 /* SDL_locale.h */; settings = {ATTRIBUTES = (Public, ); }; };
F3631C652488534E004F28EA /* SDL_locale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26792462701100718109 /* SDL_locale.h */; settings = {ATTRIBUTES = (Public, ); }; };
F376F6192559B29300CFC0BC /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F376F6182559B29300CFC0BC /* OpenGLES.framework */; platformFilter = ios; };
@@ -4072,8 +4054,6 @@
BECDF6B30761BA81005FE872 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; };
BECDF6BE0761BA81005FE872 /* SDL2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SDL2; sourceTree = BUILT_PRODUCTS_DIR; };
DB31407717554B71006C0E22 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
F3249B1C285A85FF00DB9B5C /* SDL_memset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_memset.c; sourceTree = "<group>"; };
F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_memcpy.c; sourceTree = "<group>"; };
F376F6182559B29300CFC0BC /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
F376F61A2559B2AF00CFC0BC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/iOSSupport/System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
F376F6312559B31D00CFC0BC /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/iOSSupport/System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
@@ -5139,8 +5119,6 @@
A7D8A8D423E2514000DCD162 /* SDL_getenv.c */,
A7D8A8D323E2514000DCD162 /* SDL_iconv.c */,
A7D8A8D923E2514000DCD162 /* SDL_malloc.c */,
F3249B1D285A85FF00DB9B5C /* SDL_memcpy.c */,
F3249B1C285A85FF00DB9B5C /* SDL_memset.c */,
A7D8A8D723E2514000DCD162 /* SDL_qsort.c */,
A7D8A8D823E2514000DCD162 /* SDL_stdlib.c */,
A7D8A8D523E2514000DCD162 /* SDL_string.c */,
@@ -7711,7 +7689,6 @@
A75FCE5023E25AB700529352 /* SDL_syspower.m in Sources */,
A75FCE5123E25AB700529352 /* e_log10.c in Sources */,
A75FCE5223E25AB700529352 /* SDL_uikitopenglview.m in Sources */,
F3249B2E285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A75FCE5323E25AB700529352 /* SDL_mixer.c in Sources */,
5616CA64252BB35F005D5928 /* SDL_url.c in Sources */,
A75FCE5423E25AB700529352 /* SDL_events.c in Sources */,
@@ -7767,7 +7744,6 @@
F3F07D61269640160074468B /* SDL_hidapi_luna.c in Sources */,
A75FCE8923E25AB700529352 /* SDL_rwopsbundlesupport.m in Sources */,
A75FCE8A23E25AB700529352 /* SDL_video.c in Sources */,
F3249B25285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A75FCE8B23E25AB700529352 /* SDL_offscreenopengl.c in Sources */,
A75FCE8C23E25AB700529352 /* SDL_uikitmetalview.m in Sources */,
A75FCE8D23E25AB700529352 /* SDL_steamcontroller.c in Sources */,
@@ -7905,7 +7881,6 @@
A75FD00923E25AC700529352 /* SDL_syspower.m in Sources */,
A75FD00A23E25AC700529352 /* e_log10.c in Sources */,
A75FD00B23E25AC700529352 /* SDL_uikitopenglview.m in Sources */,
F3249B2F285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A75FD00C23E25AC700529352 /* SDL_mixer.c in Sources */,
5616CA67252BB361005D5928 /* SDL_url.c in Sources */,
A75FD00D23E25AC700529352 /* SDL_events.c in Sources */,
@@ -7961,7 +7936,6 @@
F3F07D62269640160074468B /* SDL_hidapi_luna.c in Sources */,
A75FD04223E25AC700529352 /* SDL_rwopsbundlesupport.m in Sources */,
A75FD04323E25AC700529352 /* SDL_video.c in Sources */,
F3249B26285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A75FD04423E25AC700529352 /* SDL_offscreenopengl.c in Sources */,
A75FD04523E25AC700529352 /* SDL_uikitmetalview.m in Sources */,
A75FD04623E25AC700529352 /* SDL_steamcontroller.c in Sources */,
@@ -8089,7 +8063,6 @@
A769B1D523E259AE00872273 /* SDL_render.c in Sources */,
A769B1D623E259AE00872273 /* SDL_stretch.c in Sources */,
A769B1D723E259AE00872273 /* s_floor.c in Sources */,
F3249B23285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A769B1D823E259AE00872273 /* SDL_blit_copy.c in Sources */,
A769B1D923E259AE00872273 /* e_fmod.c in Sources */,
A769B1DA23E259AE00872273 /* SDL_syspower.m in Sources */,
@@ -8152,7 +8125,6 @@
A769B21123E259AE00872273 /* SDL_quit.c in Sources */,
A769B21223E259AE00872273 /* SDL_cocoawindow.m in Sources */,
A769B21323E259AE00872273 /* SDL_sysmutex.c in Sources */,
F3249B2C285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A769B21423E259AE00872273 /* SDL_syshaptic.c in Sources */,
A769B21523E259AE00872273 /* SDL_rwopsbundlesupport.m in Sources */,
A769B21623E259AE00872273 /* SDL_video.c in Sources */,
@@ -8294,7 +8266,6 @@
A7D8AC7023E2514100DCD162 /* SDL_uikitopenglview.m in Sources */,
A7D8B76523E2514300DCD162 /* SDL_mixer.c in Sources */,
A7D8BB5823E2514500DCD162 /* SDL_events.c in Sources */,
F3249B28285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A7D8ADE723E2514100DCD162 /* SDL_blit_0.c in Sources */,
A7D8BB0A23E2514500DCD162 /* k_tan.c in Sources */,
A75FDBCF23EA380300529352 /* SDL_hidapi_rumble.c in Sources */,
@@ -8350,7 +8321,6 @@
F3F07D5B269640160074468B /* SDL_hidapi_luna.c in Sources */,
A7D8AB5623E2514100DCD162 /* SDL_offscreenopengl.c in Sources */,
A7D8ACC423E2514100DCD162 /* SDL_uikitmetalview.m in Sources */,
F3249B1F285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A7D8BA5C23E2514400DCD162 /* SDL_shaders_gles2.c in Sources */,
A7D8B14123E2514200DCD162 /* SDL_blit_1.c in Sources */,
5605720F2473688000B46B66 /* SDL_locale.c in Sources */,
@@ -8488,7 +8458,6 @@
A7D8AC7123E2514100DCD162 /* SDL_uikitopenglview.m in Sources */,
A7D8B76623E2514300DCD162 /* SDL_mixer.c in Sources */,
A7D8BB5923E2514500DCD162 /* SDL_events.c in Sources */,
F3249B29285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A7D8ADE823E2514100DCD162 /* SDL_blit_0.c in Sources */,
A7D8BB0B23E2514500DCD162 /* k_tan.c in Sources */,
A75FDBD023EA380300529352 /* SDL_hidapi_rumble.c in Sources */,
@@ -8544,7 +8513,6 @@
F3F07D5C269640160074468B /* SDL_hidapi_luna.c in Sources */,
A7D8AB5723E2514100DCD162 /* SDL_offscreenopengl.c in Sources */,
A7D8ACC523E2514100DCD162 /* SDL_uikitmetalview.m in Sources */,
F3249B20285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A7D8BA5D23E2514400DCD162 /* SDL_shaders_gles2.c in Sources */,
A7D8B14223E2514200DCD162 /* SDL_blit_1.c in Sources */,
560572102473688000B46B66 /* SDL_locale.c in Sources */,
@@ -8672,7 +8640,6 @@
A7D8B97E23E2514400DCD162 /* SDL_render.c in Sources */,
A7D8ABD723E2514100DCD162 /* SDL_stretch.c in Sources */,
A7D8BB0123E2514500DCD162 /* s_floor.c in Sources */,
F3249B22285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A7D8AC3D23E2514100DCD162 /* SDL_blit_copy.c in Sources */,
A7D8BAE323E2514500DCD162 /* e_fmod.c in Sources */,
A7D8B5D323E2514300DCD162 /* SDL_syspower.m in Sources */,
@@ -8735,7 +8702,6 @@
A7D8BB8523E2514500DCD162 /* SDL_quit.c in Sources */,
A7D8AEAA23E2514100DCD162 /* SDL_cocoawindow.m in Sources */,
A7D8B43E23E2514300DCD162 /* SDL_sysmutex.c in Sources */,
F3249B2B285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A7D8AAB423E2514100DCD162 /* SDL_syshaptic.c in Sources */,
A7D8B5CD23E2514300DCD162 /* SDL_rwopsbundlesupport.m in Sources */,
A7D8AC1323E2514100DCD162 /* SDL_video.c in Sources */,
@@ -8831,7 +8797,6 @@
F3984CD025BCC92900374F43 /* SDL_hidapi_stadia.c in Sources */,
A7D8AAB623E2514100DCD162 /* SDL_haptic.c in Sources */,
A7D8AF2423E2514100DCD162 /* SDL_cocoametalview.m in Sources */,
F3249B1E285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A7D8B86023E2514400DCD162 /* SDL_audiotypecvt.c in Sources */,
A7D8BBC523E2561500DCD162 /* SDL_steamcontroller.c in Sources */,
A7D8AD3223E2514100DCD162 /* SDL_blit_N.c in Sources */,
@@ -8902,7 +8867,6 @@
A7D8B4DC23E2514300DCD162 /* SDL_joystick.c in Sources */,
A7D8BA4923E2514400DCD162 /* SDL_render_gles2.c in Sources */,
A7D8AC2D23E2514100DCD162 /* SDL_surface.c in Sources */,
F3249B27285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A7D8B54B23E2514300DCD162 /* SDL_hidapi_xboxone.c in Sources */,
A7D8AD2323E2514100DCD162 /* SDL_blit_auto.c in Sources */,
F3A4909E2554D38600E92A8B /* SDL_hidapi_ps5.c in Sources */,
@@ -9023,7 +8987,6 @@
A7D8AF2723E2514100DCD162 /* SDL_cocoametalview.m in Sources */,
A7D8B86323E2514400DCD162 /* SDL_audiotypecvt.c in Sources */,
A7D8AD3523E2514100DCD162 /* SDL_blit_N.c in Sources */,
F3249B21285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A7D8BB7E23E2514500DCD162 /* SDL_dropevents.c in Sources */,
A7D8BBFA23E2574800DCD162 /* SDL_uikitopengles.m in Sources */,
A7D8BAD023E2514500DCD162 /* e_atan2.c in Sources */,
@@ -9094,7 +9057,6 @@
A7D8BA4C23E2514400DCD162 /* SDL_render_gles2.c in Sources */,
A7D8AC3023E2514100DCD162 /* SDL_surface.c in Sources */,
A7D8B54E23E2514300DCD162 /* SDL_hidapi_xboxone.c in Sources */,
F3249B2A285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A7D8AD2623E2514100DCD162 /* SDL_blit_auto.c in Sources */,
A7D8BB6C23E2514500DCD162 /* SDL_keyboard.c in Sources */,
A7D8ACEA23E2514100DCD162 /* SDL_rect.c in Sources */,
@@ -9215,7 +9177,6 @@
A7D8AF2923E2514100DCD162 /* SDL_cocoametalview.m in Sources */,
A7D8B86523E2514400DCD162 /* SDL_audiotypecvt.c in Sources */,
A7D8AC5C23E2514100DCD162 /* SDL_uikitevents.m in Sources */,
F3249B24285A85FF00DB9B5C /* SDL_memset.c in Sources */,
A7D8ACBC23E2514100DCD162 /* SDL_uikitmodes.m in Sources */,
A7D8AD3723E2514100DCD162 /* SDL_blit_N.c in Sources */,
A7D8BB8023E2514500DCD162 /* SDL_dropevents.c in Sources */,
@@ -9286,7 +9247,6 @@
A7D8B4E123E2514300DCD162 /* SDL_joystick.c in Sources */,
A7D8BA4E23E2514400DCD162 /* SDL_render_gles2.c in Sources */,
A7D8AC3223E2514100DCD162 /* SDL_surface.c in Sources */,
F3249B2D285A85FF00DB9B5C /* SDL_memcpy.c in Sources */,
A7D8B55023E2514300DCD162 /* SDL_hidapi_xboxone.c in Sources */,
A7D8AD2823E2514100DCD162 /* SDL_blit_auto.c in Sources */,
A7D8BB6E23E2514500DCD162 /* SDL_keyboard.c in Sources */,

View File

@@ -1,79 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../SDL_internal.h"
/* This file contains a portable memcpy manipulation function for SDL */
void *
SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
{
#ifdef __GNUC__
/* Presumably this is well tuned for speed.
On my machine this is twice as fast as the C code below.
*/
return __builtin_memcpy(dst, src, len);
#elif defined(HAVE_MEMCPY)
return memcpy(dst, src, len);
#elif defined(HAVE_BCOPY)
bcopy(src, dst, len);
return dst;
#else
/* GCC 4.9.0 with -O3 will generate movaps instructions with the loop
using Uint32* pointers, so we need to make sure the pointers are
aligned before we loop using them.
*/
if (((uintptr_t)src & 0x3) || ((uintptr_t)dst & 0x3)) {
/* Do an unaligned byte copy */
Uint8 *srcp1 = (Uint8 *)src;
Uint8 *dstp1 = (Uint8 *)dst;
while (len--) {
*dstp1++ = *srcp1++;
}
} else {
size_t left = (len % 4);
Uint32 *srcp4, *dstp4;
Uint8 *srcp1, *dstp1;
srcp4 = (Uint32 *) src;
dstp4 = (Uint32 *) dst;
len /= 4;
while (len--) {
*dstp4++ = *srcp4++;
}
srcp1 = (Uint8 *) srcp4;
dstp1 = (Uint8 *) dstp4;
switch (left) {
case 3:
*dstp1++ = *srcp1++;
case 2:
*dstp1++ = *srcp1++;
case 1:
*dstp1++ = *srcp1++;
}
}
return dst;
#endif /* __GNUC__ */
}
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -1,75 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../SDL_internal.h"
/* This file contains a portable memset manipulation function for SDL */
void *
SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
{
#if defined(HAVE_MEMSET)
return memset(dst, c, len);
#else
size_t left;
Uint32 *dstp4;
Uint8 *dstp1 = (Uint8 *) dst;
Uint8 value1;
Uint32 value4;
/* The value used in memset() is a byte, passed as an int */
c &= 0xff;
/* The destination pointer needs to be aligned on a 4-byte boundary to
* execute a 32-bit set. Set first bytes manually if needed until it is
* aligned. */
value1 = (Uint8)c;
while ((uintptr_t)dstp1 & 0x3) {
if (len--) {
*dstp1++ = value1;
} else {
return dst;
}
}
value4 = ((Uint32)c | ((Uint32)c << 8) | ((Uint32)c << 16) | ((Uint32)c << 24));
dstp4 = (Uint32 *) dstp1;
left = (len % 4);
len /= 4;
while (len--) {
*dstp4++ = value4;
}
dstp1 = (Uint8 *) dstp4;
switch (left) {
case 3:
*dstp1++ = value1;
case 2:
*dstp1++ = value1;
case 1:
*dstp1++ = value1;
}
return dst;
#endif /* HAVE_MEMSET */
}
/* vi: set ts=4 sw=4 expandtab: */

717
src/stdlib/SDL_mslibc.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff