home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / charmax.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  38 lines

  1. /***
  2. *charmax.c - definition of _charmax variable
  3. *
  4. *       Copyright (c) 1993-1997, 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, the value of CHAR_MAX changes. To reflect this
  12. *       change in the lconv structure, we initialize the structure to SCHAR_MAX,
  13. *       and when any of the users modules are compiled -J, the structure is updated.
  14. *
  15. *       Files involved:
  16. *
  17. *       locale.h - if -J, generates an unresolved external to _charmax
  18. *       charmax.c - defines _charmax and sets to UCHAR_MAX (255), places
  19. *               _lconv_init in startup initializer table if pulled in by -J
  20. *       lconv.c - initializes lconv structure to SCHAR_MAX (127),
  21. *               since libraries built without -J
  22. *       lcnvinit.c - sets lconv members to 25.
  23. **
  24. *******************************************************************************/
  25.  
  26. #ifdef _MSC_VER
  27.  
  28. #include <internal.h>
  29.  
  30. void __lconv_init(void);
  31.  
  32. int _charmax = 255;
  33.  
  34. #pragma data_seg(".CRT$XIC")
  35. static _PVFV pinit = __lconv_init;
  36.  
  37. #endif  /* _MSC_VER */
  38.