aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-16 17:25:02 +0200
committerlemon <lsof@mailbox.org>2025-10-16 17:25:02 +0200
commit77b13b42643991fc8c2b8942ca167eb7bf156908 (patch)
treef65a402832af6111c623af02cf946f7de928e223 /common.h
parentc19b3e277399a513c5e3a02d126ba666847566df (diff)
wide str and char literals
Diffstat (limited to 'common.h')
-rw-r--r--common.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/common.h b/common.h
index f728eea..f2fff86 100644
--- a/common.h
+++ b/common.h
@@ -321,7 +321,9 @@ typechild(union type t)
static inline enum typetag
scalartypet(union type t)
{
- return t.t == TYENUM ? t.backing : t.t;
+ if (t.t == TYENUM) return t.backing;
+ if (isptrcvt(t)) return TYPTR;
+ return t.t;
}
static inline uint
typearrlen(union type t)
@@ -335,7 +337,7 @@ typearrlen(union type t)
extern uchar targ_primsizes[];
extern uchar targ_primalign[];
-extern enum typetag targ_sizetype, targ_ptrdifftype;
+extern enum typetag targ_sizetype, targ_ptrdifftype, targ_wchartype;
extern bool targ_charsigned, targ_bigendian, targ_64bit;
extern const struct mctarg *mctarg;
void targ_init(const char *);
@@ -574,6 +576,8 @@ void fatal(const struct span *, const char *, ...);
void error(const struct span *, const char *, ...);
void warn(const struct span *, const char *, ...);
void note(const struct span *, const char *, ...);
+ushort *utf8to16(uint *ulen, struct arena **, const uchar *s, size_t len);
+uint *utf8to32(uint *ulen, struct arena **, const uchar *s, size_t len);
#endif /* COMMON_H_ */