32#ifndef _RWSTD_NO_OFFSETOF
33# define OFF(T, m) offsetof (T, m)
38# define OFF(T, m) (((const char*)&((T*)0)->m) - ((const char*)(T*)0))
55#define ENTRY(type, member, comment) { \
56 OFF (lconv, member), \
57 sizeof ((lconv*)0)->member, \
64 ENTRY (
"char*", decimal_point,
""),
65 ENTRY (
"char*", thousands_sep,
""),
66 ENTRY (
"char*", grouping,
""),
67 ENTRY (
"char*", int_curr_symbol,
""),
68 ENTRY (
"char*", currency_symbol,
""),
69 ENTRY (
"char*", mon_decimal_point,
""),
70 ENTRY (
"char*", mon_thousands_sep,
""),
71 ENTRY (
"char*", mon_grouping,
""),
72 ENTRY (
"char*", positive_sign,
""),
73 ENTRY (
"char*", negative_sign,
""),
74 ENTRY (
"char", int_frac_digits,
""),
75 ENTRY (
"char", frac_digits,
""),
76 ENTRY (
"char", p_cs_precedes,
""),
77 ENTRY (
"char", p_sep_by_space,
""),
78 ENTRY (
"char", n_cs_precedes,
""),
79 ENTRY (
"char", n_sep_by_space,
""),
80 ENTRY (
"char", p_sign_posn,
""),
81 ENTRY (
"char", n_sign_posn,
"")
83#ifndef _RWSTD_NO_LCONV_INT_FMAT
86 ,
ENTRY (
"char", int_p_cs_precedes,
""),
87 ENTRY (
"char", int_n_cs_precedes,
""),
88 ENTRY (
"char", int_p_sep_by_space,
""),
89 ENTRY (
"char", int_n_sep_by_space,
""),
90 ENTRY (
"char", int_p_sign_posn,
""),
91 ENTRY (
"char", int_n_sign_posn,
"")
97 const size_t N =
sizeof lconv_info /
sizeof *lconv_info;
104 for (
size_t i = 0;
i !=
N; ++
i) {
106 for (
size_t j = 0;
j !=
N; ++
j) {
108 if (curoff == lconv_info [
j].
offset) {
110 sprintf (def + strlen (def),
113 lconv_info [
j].
name);
116 lconv_info [
j].offset = size_t (-1);
117 curoff += lconv_info [
j].size;
118 size += lconv_info [
j].size;
125 printf (
"#define _RWSTD_LCONV { "
126 "/* sizeof (lconv) == %u */ \\\n%s",
127 sizeof (lconv), def);
130 if (
size !=
sizeof (lconv)) {
131 printf (
" char _C_fill [%u]; /* fill to size */ \\\n",
132 sizeof (lconv) -
size);
IMPORT_C SInt32 printf(const Char *,...)
#define ENTRY(type, member, comment)