Hash :
df2322d7
Author :
Date :
2025-02-05T14:41:21
Replace include guards by `#pragma once` We currently have a mix of include headers, pragma once and some missing. pragma once is not standard but is widely supported, and we already use it with no issues, so I'd say it's not a problem. Let's convert all headers to pragma once to avoid the annoying include guards. The public headers are *not* converted. Signed-off-by: Ran Benita <ran@unusedvar.com>
// WARNING: This file is automatically generated by: {{ script }}
#pragma once
#include <stdint.h>
#include <unicode/uchar.h>
/* Unicode code points used in case mapping exceptions */
{% for lower, upper in upper_exceptions.items() %}
#define {{ lower | code_point_name_constant(padding=28) }} {{ lower | code_point }} // {{ lower }}
#define {{ upper | code_point_name_constant(padding=28) }} {{ upper | code_point }} // {{ upper }}
{% endfor %}
static inline uint32_t
to_simple_lower(uint32_t cp)
{
return (uint32_t)u_tolower((UChar32) cp);
}
static inline uint32_t
to_simple_upper(uint32_t cp)
{
switch (cp) {
/* Some exceptions */
{% for lower, upper in upper_exceptions.items() %}
case {{ lower | code_point_name_constant }}:
return {{ upper | code_point_name_constant }};
{% endfor %}
/* Default to the Unicode simple mapping */
default:
return (uint32_t)u_toupper((UChar32) cp);
}
}