Improved cross os C error codes implementation