Make CHAR16 use uint16_t

musl-libc doesn't like fshort-wchar so remove wchar_t usage
Use uint16_t as char16_t can be up to 32bits
Fixes ncroxon/gnu-efi#16

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Callum Farmer 2024-05-29 16:22:50 +01:00
parent 9e479726ed
commit edfda7c396
No known key found for this signature in database
GPG Key ID: 9A5B19E18CD0013C
9 changed files with 11 additions and 12 deletions

View File

@ -206,11 +206,11 @@ endif
ifeq (FreeBSD, $(findstring FreeBSD, $(OS)))
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-funsigned-char -fshort-wchar -fno-strict-aliasing \
-funsigned-char -fno-strict-aliasing \
-ffreestanding -fno-stack-protector
else
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign -Werror \
-funsigned-char -fshort-wchar -fno-strict-aliasing \
-funsigned-char -fno-strict-aliasing \
-ffreestanding -fno-stack-protector -fno-stack-check \
$(if $(findstring gcc,$(CC)),-fno-merge-all-constants,)
endif

View File

@ -40,7 +40,7 @@ typedef int64_t intptr_t;
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
typedef uint64_t UINT64;

View File

@ -48,7 +48,7 @@ typedef int32_t intptr_t;
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
typedef uint64_t UINT64;

View File

@ -87,7 +87,7 @@ Revision History
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16

View File

@ -74,7 +74,7 @@ Revision History
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
typedef uint64_t UINT64;

View File

@ -44,7 +44,7 @@ typedef int64_t intptr_t;
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
typedef uint64_t UINT64;

View File

@ -42,7 +42,7 @@ typedef int64_t intptr_t;
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
typedef uint64_t UINT64;

View File

@ -17,13 +17,12 @@
*/
#include <stdint.h>
#include <stddef.h>
//
// Basic EFI types of various widths
//
#include <stddef.h>
typedef uint64_t UINT64;
typedef int64_t INT64;
typedef uint32_t UINT32;
@ -33,7 +32,7 @@ typedef int16_t INT16;
typedef uint8_t UINT8;
typedef int8_t INT8;
typedef char CHAR8;
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
#undef VOID
typedef void VOID;

View File

@ -98,7 +98,7 @@ Revision History
#include <stddef.h>
typedef wchar_t CHAR16;
typedef uint16_t CHAR16;
#define WCHAR CHAR16
typedef uint64_t UINT64;