*fixed a compile issue; +added a git ignore list.

This commit is contained in:
Wang Renxin 2017-01-16 18:00:27 +08:00
parent edf83de690
commit 9ae2cd0ea4
2 changed files with 24 additions and 4 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
/temp
/my_basic.VC.db
/my_basic.VC.VC.opendb
/.vs/my_basic/v14
*.DS_Store
*.exp
*.idb
*.ilk
*.iobj
*.ipdb
*.lib
*.ncb
*.obj
*.pdb
*.suo

View File

@ -4589,13 +4589,16 @@ static mb_input_func_t _get_inputer(mb_interpreter_t* s) {
/* Print a string */
static void _print_string(mb_interpreter_t* s, _object_t* obj) {
mb_assert(s && obj);
#if defined MB_CP_VC && defined MB_ENABLE_UNICODE
char* loc = setlocale(LC_ALL, "");
char* str = obj->data.string ? obj->data.string : MB_NULL_STRING;
char* loc = 0;
char* str = 0;
_dynamic_buffer_t buf;
size_t lbuf = 0;
mb_assert(s && obj);
loc = setlocale(LC_ALL, "");
str = obj->data.string ? obj->data.string : MB_NULL_STRING;
_INIT_BUF(buf);
while((lbuf = (size_t)mb_bytes_to_wchar(str, &_WCHAR_BUF_PTR(buf), _WCHARS_OF_BUF(buf))) > _WCHARS_OF_BUF(buf)) {
_RESIZE_WCHAR_BUF(buf, lbuf);
@ -4604,6 +4607,8 @@ static void _print_string(mb_interpreter_t* s, _object_t* obj) {
_DISPOSE_BUF(buf);
setlocale(LC_ALL, loc);
#else /* MB_CP_VC && MB_ENABLE_UNICODE */
mb_assert(s && obj);
_get_printer(s)("%s", obj->data.string ? obj->data.string : MB_NULL_STRING);
#endif /* MB_CP_VC && MB_ENABLE_UNICODE */
}