Signed-off-by: Jean Privat <jean@pryen.org>
import end # Mark this module is a top level one. (must be only one)
-`{
-#include <errno.h>
-`}
-
###############################################################################
# System Classes #
###############################################################################
fun run do main
# Number of the last error
- fun errno: Int is extern `{
- return errno;
- `}
+ fun errno: Int is extern "sys_errno"
end
# Quit the program with a specific return code
*/
#include <stdlib.h>
+#include <errno.h>
#define address_is_null(x) ((x)==NULL)
+#define sys_errno(x) (errno)
#endif
redef class Int
# Wrapper of strerror C function
- private fun strerror_ext: NativeString is extern `{
- return strerror(recv);
- `}
+ private fun strerror_ext: NativeString is extern "strerror"
# Returns a string describing error number
fun strerror: String do return strerror_ext.to_s