crt: Fix return value of fegetexcept(), fedisableexcept() and feenableexcept() functions
Function __mingw_controlfp() returns bits for disabled exceptions,
but function fegetexcept() must return bits for enabled exceptions.
So negate bits for return value.
Function __mingw_controlfp() when modifying cw returns new state,
but functions fedisableexcept() and feenableexcept() must return old state.
So before modifying cw via __mingw_controlfp(), call fegetexcept() to
calculate return value of both fedisableexcept() and feenableexcept()
functions. Also checks for input argument and return -1 when is invalid.
Signed-off-by: LIU Hao <lh_mouse@126.com>
3 files changed