4.6.13. __LC_CTYPE_DEF

This macro is used to create CTYPE blocks. The definitionfrom rt_locale.h and sample code are shown in Example 4.9.

Example 4.9. LC_CTYPE_DEF

#define __LC_CTYPE_DEF(sym,ln) \	
static const int sym##_index = ~3 & (3 + (268+(~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 char sym##_start = 0; \	
static const char sym##_table[256] =

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.


See _get_lc_ctype().


Because the compiler optimizes the data segment, it reorders and removes parts of locale definitions, and breaks the data structures. The code examples provided are for informational purposes only. In practice, the definitions require additional pragmas to disable optimizations.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D