Datasheet

The C and C++ Libraries
4-46 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
4.6.16 __LC_NUMERIC_DEF
This macro is used to create blocks used when formatting numbers. The definition from
rt_locale.h
and sample code are shown in Example 4-13.
For all the macros, the first two arguments are a symbol prefix and a locale name. The
resulting locale block is addressed by the expression
&symprefix_start
, and the index
entry by the expression
&symprefix_index
.
Example 4-13 LC_NUMERIC_DEF
#define __LC_NUMERIC_DEF(sym,ln,dp,ts,gr) \
static const int sym##_index = ~3 & (3 + (sizeof(dp)+sizeof(ts)+sizeof(gr)+ \
20) + (~3 & (3 + sizeof(ln)))); \
static const char sym##_lname[~3 & (3 + sizeof(ln))] = ln; \
static const int sym##_pname = -4-(~3 & (3 + sizeof(ln))); \
static const int sym##_start = 12; \
static const int sym##_tsoff = (sizeof(dp)+12); \
static const int sym##_groff = (sizeof(dp)+sizeof(ts)+12); \
static const char sym##_dptxt[] = dp; \
static const char sym##_tstxt[] = ts; \
static const char sym##_grtxt[] = gr;
Usage
See _get_lc_numeric() on page 4-37. See also __LC_CTYPE_DEF on page 4-42 for
details of the side-effects of compiler optimizations.
4.6.17 __LC_MONETARY_DEF
This macro is used to create blocks used when formatting monetary values. The
definition from
rt_locale.h
and sample code are shown in Example 4-14.
For all the macros, the first two arguments are a symbol prefix and a locale name. The
resulting locale block is addressed by the expression
&symprefix_start
, and the index
entry by the expression
&symprefix_index
.
Example 4-14 LC_MONETARY_DEF
#define __LC_MONETARY_DEF(sym,ln,ic,cs,md,mt,mg,ps,ns, \
id,fd,pc,pS,nc,nS,pp,np) \
static const int sym##_index = ~3 & (3 + (sizeof(ic)+sizeof(cs)+sizeof(md)+ \
sizeof(mt)+sizeof(mg)+sizeof(ps)+ \
sizeof(ns)+44) \