|
Packit Service |
8bf002 |
/* m_33_jis.c: Wide character constant encoded in ISO-2022-JP. */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#include "defs.h"
|
|
Packit Service |
8bf002 |
#include <limits.h>
|
|
Packit Service |
8bf002 |
#define BYTES_VAL (1 << CHAR_BIT)
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
main( void)
|
|
Packit Service |
8bf002 |
{
|
|
Packit Service |
8bf002 |
char * ptr;
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
fputs( "started\n", stderr);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 33.1: L'ch'. */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#pragma __setlocale( "jis") /* For MCPP */
|
|
Packit Service |
8bf002 |
#pragma setlocale( "jis") /* For MCPP on VC */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#if L'字' == 0x3b * BYTES_VAL + 0x7a
|
|
Packit Service |
8bf002 |
/* This line doesn't work unless "shift states" are processed. */
|
|
Packit Service |
8bf002 |
ptr = "Wide character is encoded in ISO-2022-JP.";
|
|
Packit Service |
8bf002 |
#elif L'字' == 0x7a * BYTES_VAL + 0x3b
|
|
Packit Service |
8bf002 |
/* This line doesn't work unless "shift states" are processed. */
|
|
Packit Service |
8bf002 |
ptr = "Wide character is encoded in ISO-2022-JP."
|
|
Packit Service |
8bf002 |
"Inverted order of evaluation.";
|
|
Packit Service |
8bf002 |
#else
|
|
Packit Service |
8bf002 |
ptr = "I cannot understand ISO-2022-JP.";
|
|
Packit Service |
8bf002 |
#endif
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
assert( strcmp( ptr, "I cannot understand ISO-2022-JP.") != 0);
|
|
Packit Service |
8bf002 |
fputs( "success\n", stderr);
|
|
Packit Service |
8bf002 |
return 0;
|
|
Packit Service |
8bf002 |
}
|
|
Packit Service |
8bf002 |
|