11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The DLIB runtime environmentIf your application requires a different locale support, you need to rebuild the library.CUSTOMIZING THE LOCALE SUPPORTIf you decide to rebuild the library, you can choose between the following locales:●●●The standard C localeThe POSIX localeA wide range of European locales.Locale configuration symbolsThe configuration symbol _DLIB_FULL_LOCALE_SUPPORT, which is defined in thelibrary configuration file, determines whether a library has support for a locale interfaceor not. The locale configuration symbols _LOCALE_USE_LANG_REGION and_ENCODING_USE_ENCODING define all the supported locales and encodings.If you want to customize the locale support, you simply define the locale configurationsymbols required by your application. For more information, see Building and using acustomized library, page 55.Note: If you use multibyte characters in your C or assembler source code, make surethat you select the correct locale symbol (the local host locale).Building a library without support for locale interfaceThe locale interface is not included if the configuration symbol_DLIB_FULL_LOCALE_SUPPORT is set to 0 (zero). This means that a hardwired localeis used—by default the standard C locale—but you can choose one of the supportedlocale configuration symbols. The setlocale function is not available and cantherefore not be used for changing locales at runtime.Building a library with support for locale interfaceSupport for the locale interface is obtained if the configuration symbol_DLIB_FULL_LOCALE_SUPPORT is set to 1. By default, the standard C locale is used,but you can define as many configuration symbols as required. Because the setlocalefunction will be available in your application, it will be possible to switch locales atruntime.CHANGING LOCALES AT RUNTIMEThe standard library function setlocale is used for selecting the appropriate portionof the application’s locale when the application is running.The setlocale function takes two arguments. The first one is a locale category that isconstructed after the pattern LC_CATEGORY. The second argument is a string thatPart 1. Using the compiler65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!