@@ -1346,11 +1346,11 @@ static bool_t mb_is_little_endian(void);
1346
1346
1347
1347
/** Unicode handling */
1348
1348
1349
- #if defined MB_CP_VC && defined MB_ENABLE_UNICODE
1349
+ #if defined MB_CP_VC && defined MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING
1350
1350
static int mb_bytes_to_wchar(const char* sz, wchar_t** out, size_t size);
1351
1351
static int mb_bytes_to_wchar_ansi(const char* sz, wchar_t** out, size_t size);
1352
1352
static int mb_wchar_to_bytes(const wchar_t* sz, char** out, size_t size);
1353
- #endif /* MB_CP_VC && MB_ENABLE_UNICODE */
1353
+ #endif /* MB_CP_VC && MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING */
1354
1354
1355
1355
static int mb_uu_getbom(const char** ch);
1356
1356
#ifdef MB_ENABLE_UNICODE
@@ -3346,7 +3346,7 @@ static bool_t mb_is_little_endian(void) {
3346
3346
3347
3347
/** Unicode handling */
3348
3348
3349
- #if defined MB_CP_VC && defined MB_ENABLE_UNICODE
3349
+ #if defined MB_CP_VC && defined MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING
3350
3350
/* Map a UTF8 character string to a UTF16 (wide character) string */
3351
3351
static int mb_bytes_to_wchar(const char* sz, wchar_t** out, size_t size) {
3352
3352
int result = MultiByteToWideChar(CP_UTF8, 0, sz, -1, 0, 0);
@@ -3373,7 +3373,7 @@ static int mb_wchar_to_bytes(const wchar_t* sz, char** out, size_t size) {
3373
3373
3374
3374
return result;
3375
3375
}
3376
- #endif /* MB_CP_VC && MB_ENABLE_UNICODE */
3376
+ #endif /* MB_CP_VC && MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING */
3377
3377
3378
3378
/* Determine whether a string begins with a BOM, and ignore it */
3379
3379
static int mb_uu_getbom(const char** ch) {
@@ -4926,7 +4926,7 @@ static int _standard_printer(mb_interpreter_t* s, const char* fmt, ...) {
4926
4926
4927
4927
/* Print a string */
4928
4928
static void _print_string(mb_interpreter_t* s, _object_t* obj) {
4929
- #if defined MB_CP_VC && defined MB_ENABLE_UNICODE
4929
+ #if defined MB_CP_VC && defined MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING
4930
4930
char* str = 0;
4931
4931
_dynamic_buffer_t buf;
4932
4932
size_t lbuf = 0;
@@ -4940,11 +4940,11 @@ static void _print_string(mb_interpreter_t* s, _object_t* obj) {
4940
4940
}
4941
4941
_get_printer(s)(s, "%ls", _WCHAR_BUF_PTR(buf));
4942
4942
_DISPOSE_BUF(buf);
4943
- #else /* MB_CP_VC && MB_ENABLE_UNICODE */
4943
+ #else /* MB_CP_VC && MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING */
4944
4944
mb_assert(s && obj);
4945
4945
4946
4946
_get_printer(s)(s, "%s", obj->data.string ? obj->data.string : MB_NULL_STRING);
4947
- #endif /* MB_CP_VC && MB_ENABLE_UNICODE */
4947
+ #endif /* MB_CP_VC && MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING */
4948
4948
}
4949
4949
4950
4950
/** Parsing helpers */
@@ -18610,7 +18610,7 @@ static int _std_input(mb_interpreter_t* s, void** l) {
18610
18610
safe_free(obj->data.variable->data->data.string);
18611
18611
}
18612
18612
len = (size_t)_get_inputer(s)(s, pmt, line, sizeof(line));
18613
- #if defined MB_CP_VC && defined MB_ENABLE_UNICODE
18613
+ #if defined MB_CP_VC && defined MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING
18614
18614
do {
18615
18615
_dynamic_buffer_t buf;
18616
18616
_dynamic_buffer_t wbuf;
@@ -18629,12 +18629,12 @@ static int _std_input(mb_interpreter_t* s, void** l) {
18629
18629
obj->data.variable->data->data.string = _HEAP_CHAR_BUF(buf);
18630
18630
obj->data.variable->data->is_ref = false;
18631
18631
} while(0);
18632
- #else /* MB_CP_VC && MB_ENABLE_UNICODE */
18632
+ #else /* MB_CP_VC && MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING */
18633
18633
obj->data.variable->data->data.string = mb_memdup(line, (unsigned)(len + 1));
18634
18634
#if MB_PRINT_INPUT_CONTENT
18635
18635
_get_printer(s)(s, "%s\n", obj->data.variable->data->data.string);
18636
18636
#endif /* MB_PRINT_INPUT_CONTENT */
18637
- #endif /* MB_CP_VC && MB_ENABLE_UNICODE */
18637
+ #endif /* MB_CP_VC && MB_ENABLE_UNICODE && MB_UNICODE_NEED_CONVERTING */
18638
18638
ast = ast->next;
18639
18639
} else {
18640
18640
_handle_error_on_obj(s, SE_RN_INVALID_ID_USAGE, s->source_file, DON(ast), MB_FUNC_ERR, _exit, result);
0 commit comments