Fixed the printing issue of a long double value in MINGW32.
- The long double type in MINGW32 is 12 bytes while the double type is 8 bytes. - The compiled binary is linked against the Microsoft library. - In that library, both the long double and the double type are 8 bytes. - The code has been changed to use the double type if __MINGW32__ is defined.
This commit is contained in:
		| @ -1,5 +1,5 @@ | |||||||
| /* | /* | ||||||
|  * $Id: print.c 337 2008-08-20 09:17:25Z baconevi $ |  * $Id: print.c 467 2008-12-09 09:55:51Z baconevi $ | ||||||
|  * |  * | ||||||
|  * {License} |  * {License} | ||||||
|  */ |  */ | ||||||
| @ -73,7 +73,13 @@ static int __print (ase_lsp_t* lsp, const ase_lsp_obj_t* obj, ase_bool_t prt_con | |||||||
| 			lsp->prmfns.misc.sprintf ( | 			lsp->prmfns.misc.sprintf ( | ||||||
| 				lsp->prmfns.misc.data, | 				lsp->prmfns.misc.data, | ||||||
| 				buf, ASE_COUNTOF(buf),  | 				buf, ASE_COUNTOF(buf),  | ||||||
| 				ASE_T("%Lf"), (long double)ASE_LSP_RVAL(obj)); | 				ASE_T("%Lf"),  | ||||||
|  | 			#ifdef __MINGW32__ | ||||||
|  | 				(double)ASE_LSP_RVAL(obj) | ||||||
|  | 			#else | ||||||
|  | 				(long double)ASE_LSP_RVAL(obj) | ||||||
|  | 			#endif | ||||||
|  | 			); | ||||||
|  |  | ||||||
| 			OUTPUT_STR (lsp, buf); | 			OUTPUT_STR (lsp, buf); | ||||||
| 			break; | 			break; | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user