|
Packit Service |
8bf002 |
/* m_33_sjis.c: Wide character constant encoded in shift-JIS. */
|
|
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( "sjis") /* For MCPP */
|
|
Packit Service |
8bf002 |
#pragma setlocale( "japanese") /* For Visual C */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#if L'Žš' == '\x8e' * BYTES_VAL + '\x9a'
|
|
Packit Service |
8bf002 |
ptr = "Wide character is encoded in shift-JIS.";
|
|
Packit Service |
8bf002 |
#elif L'Žš' == '\x9a' * BYTES_VAL + '\x8e'
|
|
Packit Service |
8bf002 |
ptr = "Wide character is encoded in shift-JIS."
|
|
Packit Service |
8bf002 |
"Inverted order of evaluation.";
|
|
Packit Service |
8bf002 |
#else
|
|
Packit Service |
8bf002 |
ptr = "I cannot understand shift-JIS.";
|
|
Packit Service |
8bf002 |
#endif
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
assert( strcmp( ptr, "I cannot understand shift-JIS.") != 0);
|
|
Packit Service |
8bf002 |
fputs( "success\n", stderr);
|
|
Packit Service |
8bf002 |
return 0;
|
|
Packit Service |
8bf002 |
}
|
|
Packit Service |
8bf002 |
|