summaryrefslogtreecommitdiffstats
path: root/winpr/libwinpr/crt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
commit827a4c3faa27e0c186452585b15094eee1119085 (patch)
treee6a08b0c767863d66f7d4a9de80db5edc7db29be /winpr/libwinpr/crt
parentReleasing progress-linux version 3.3.0+dfsg1-1~progress7.99u1. (diff)
downloadfreerdp3-827a4c3faa27e0c186452585b15094eee1119085.tar.xz
freerdp3-827a4c3faa27e0c186452585b15094eee1119085.zip
Merging upstream version 3.5.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'winpr/libwinpr/crt')
-rw-r--r--winpr/libwinpr/crt/alignment.c10
-rw-r--r--winpr/libwinpr/crt/test/TestUnicodeConversion.c8
2 files changed, 6 insertions, 12 deletions
diff --git a/winpr/libwinpr/crt/alignment.c b/winpr/libwinpr/crt/alignment.c
index e313c2d..71dd0e0 100644
--- a/winpr/libwinpr/crt/alignment.c
+++ b/winpr/libwinpr/crt/alignment.c
@@ -36,14 +36,6 @@
#include <stdlib.h>
-#if defined(__APPLE__)
-#include <malloc/malloc.h>
-#elif defined(__FreeBSD__) || defined(__OpenBSD__)
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-
#include "../log.h"
#define TAG WINPR_TAG("crt")
@@ -108,7 +100,7 @@ void* winpr_aligned_offset_malloc(size_t size, size_t alignment, size_t offset)
/* malloc size + alignment to make sure we can align afterwards */
#if defined(_ISOC11_SOURCE)
base = aligned_alloc(alignment, alignsize);
-#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
+#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600)
if (posix_memalign(&base, alignment, alignsize) != 0)
return NULL;
#else
diff --git a/winpr/libwinpr/crt/test/TestUnicodeConversion.c b/winpr/libwinpr/crt/test/TestUnicodeConversion.c
index a5c4c75..187a068 100644
--- a/winpr/libwinpr/crt/test/TestUnicodeConversion.c
+++ b/winpr/libwinpr/crt/test/TestUnicodeConversion.c
@@ -24,10 +24,12 @@ typedef struct
// TODO: The unit tests do not check for valid code points, so always end the test
// strings with a simple ASCII symbol for now.
static const testcase_t unit_testcases[] = {
- { "foo", 3, "f\x00o\x00o\x00\x00\x00", 3 },
- { "foo", 4, "f\x00o\x00o\x00\x00\x00", 4 },
+ { "foo", 3, (const WCHAR*)"f\x00o\x00o\x00\x00\x00", 3 },
+ { "foo", 4, (const WCHAR*)"f\x00o\x00o\x00\x00\x00", 4 },
{ "βœŠπŸŽ…Δ™Κ₯κ£Έπ‘—Ša", 19,
- "\x0a\x27\x3c\xd8\x85\xdf\x19\x01\xa5\x02\xf8\xa8\x05\xd8\xca\xdd\x61\x00\x00\x00", 9 }
+ (const WCHAR*)"\x0a\x27\x3c\xd8\x85\xdf\x19\x01\xa5\x02\xf8\xa8\x05\xd8\xca\xdd\x61\x00\x00"
+ "\x00",
+ 9 }
};
static void create_prefix(char* prefix, size_t prefixlen, size_t buffersize, SSIZE_T rc,