16 lines
409 B
C
16 lines
409 B
C
/* This software is licensed by the MIT License, see LICENSE file */
|
|
/* Copyright © 2022 Gregory Lirent */
|
|
|
|
#include "build.h"
|
|
|
|
const char32_t* fromchar32_unicode(unsigned int* uc, const char32_t* s) {
|
|
unsigned int* p = (void*)s;
|
|
|
|
if (*p <= 0x10ffff && (*p < 0xd800 || *p > 0xdfff)) {
|
|
*uc = *p;
|
|
return ++s;
|
|
}
|
|
|
|
return (void*)(size_t)(*uc = 0);
|
|
}
|