From 43beb913dad6d640ed9485aa038f24419eb13fdc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 11 Apr 2024 19:49:42 +0300 Subject: [PATCH] [CRT] Move rand to stdlib, where it belongs --- sdk/lib/crt/math/math.cmake | 5 ----- sdk/lib/crt/{math => stdlib}/rand.c | 0 sdk/lib/crt/{math => stdlib}/rand_nt.c | 0 sdk/lib/crt/stdlib/stdlib.cmake | 10 ++++++++-- 4 files changed, 8 insertions(+), 7 deletions(-) rename sdk/lib/crt/{math => stdlib}/rand.c (100%) rename sdk/lib/crt/{math => stdlib}/rand_nt.c (100%) diff --git a/sdk/lib/crt/math/math.cmake b/sdk/lib/crt/math/math.cmake index a888242644e..5821259646a 100644 --- a/sdk/lib/crt/math/math.cmake +++ b/sdk/lib/crt/math/math.cmake @@ -240,17 +240,12 @@ list(APPEND CRT_MATH_SOURCE math/ldiv.c math/logf.c math/powf.c - math/rand.c ) list(APPEND CRT_MATH_ASM_SOURCE ${LIBCNTPR_MATH_ASM_SOURCE} ) -list(APPEND LIBCNTPR_MATH_SOURCE - math/rand_nt.c -) - if(ARCH STREQUAL "i386") list(APPEND ATAN2_ASM_SOURCE math/i386/atan2_asm.s) elseif(ARCH STREQUAL "amd64") diff --git a/sdk/lib/crt/math/rand.c b/sdk/lib/crt/stdlib/rand.c similarity index 100% rename from sdk/lib/crt/math/rand.c rename to sdk/lib/crt/stdlib/rand.c diff --git a/sdk/lib/crt/math/rand_nt.c b/sdk/lib/crt/stdlib/rand_nt.c similarity index 100% rename from sdk/lib/crt/math/rand_nt.c rename to sdk/lib/crt/stdlib/rand_nt.c diff --git a/sdk/lib/crt/stdlib/stdlib.cmake b/sdk/lib/crt/stdlib/stdlib.cmake index 3ab02840e34..ba493f3f919 100644 --- a/sdk/lib/crt/stdlib/stdlib.cmake +++ b/sdk/lib/crt/stdlib/stdlib.cmake @@ -1,10 +1,15 @@ -list(APPEND LIBCNTPR_STDLIB_SOURCE +list(APPEND COMMON_STDLIB_SOURCE stdlib/qsort.c ) +list(APPEND LIBCNTPR_STDLIB_SOURCE + ${COMMON_STDLIB_SOURCE} + stdlib/rand_nt.c +) + list(APPEND CRT_STDLIB_SOURCE - ${LIBCNTPR_STDLIB_SOURCE} + ${COMMON_STDLIB_SOURCE} stdlib/_exit.c stdlib/_set_abort_behavior.c stdlib/abort.c @@ -22,6 +27,7 @@ list(APPEND CRT_STDLIB_SOURCE stdlib/mbstowcs.c stdlib/obsol.c stdlib/putenv.c + stdlib/rand.c stdlib/rot.c stdlib/senv.c stdlib/swab.c