Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8 KiB

  1. /***
  2. *charmax.c - definition of _charmax variable
  3. *
  4. * Copyright (c) 1993-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines _charmax
  8. *
  9. * According to ANSI, certain elements of the lconv structure must be
  10. * initialized to CHAR_MAX and the value of CHAR_MAX changes when
  11. * the user compiles -J. To reflect this change in the lconv structure,
  12. * we initialize the structure to SCHAR_MAX, and when any of the users
  13. * modules are compiled -J, the structure is updated.
  14. *
  15. * Note that this is not done for DLLs linked to the CRT DLL, because
  16. * we do not want such DLLs to override the -J setting for an EXE
  17. * linked to the CRT DLL. See comments in crtexe.c.
  18. *
  19. * Files involved:
  20. *
  21. * locale.h - if -J, generates an unresolved external to _charmax
  22. * charmax.c - defines _charmax and sets to UCHAR_MAX (255), places
  23. * _lconv_init in startup initializer table if pulled in by -J
  24. * lconv.c - initializes lconv structure to SCHAR_MAX (127),
  25. * since libraries built without -J
  26. * lcnvinit.c - sets lconv members to 25.
  27. **
  28. *Revision History:
  29. * 04-06-93 CFW Module created.
  30. * 04-14-93 CFW Change _charmax from short to int, cleanup.
  31. * 09-15-93 SKS Use ANSI conformant "__" names.
  32. * 11-01-93 GJF Cleaned up a bit.
  33. * 04-28-99 PML Wrap __declspec(allocate()) in _CRTALLOC macro.
  34. * 03-27-01 PML .CRT$XI routines must now return 0 or _RT_* fatal
  35. * error code (vs7#231220)
  36. *
  37. *******************************************************************************/
  38. #ifdef _MSC_VER
  39. #include <sect_attribs.h>
  40. #include <internal.h>
  41. int __lconv_init(void);
  42. int _charmax = 255;
  43. #pragma data_seg(".CRT$XIC")
  44. _CRTALLOC(".CRT$XIC") static _PIFV pinit = __lconv_init;
  45. #pragma data_seg()
  46. #endif /* _MSC_VER */