diff --git a/libc/src/string.cpp b/libc/src/string.cpp index 9c46a6c8..eabdc00a 100644 --- a/libc/src/string.cpp +++ b/libc/src/string.cpp @@ -1,4 +1,3 @@ -#define _LUNA_SYSTEM_ERROR_EXTENSIONS #include #include @@ -7,6 +6,8 @@ extern "C" // All other string functions are defined in luna/CString.cpp, so the same definitions can be used by both kernel // and userspace. + extern "C++" const char* error_string(int); + char* strerror(int errnum) { return const_cast(error_string(errnum)); diff --git a/libluna/include/luna/Result.h b/libluna/include/luna/Result.h index 9c261e74..a902dd0b 100644 --- a/libluna/include/luna/Result.h +++ b/libluna/include/luna/Result.h @@ -1,5 +1,4 @@ #pragma once -#define _LUNA_SYSTEM_ERROR_EXTENSIONS #include #include #include @@ -7,6 +6,8 @@ #include #include +extern const char* error_string(int error); + struct Error { Error(int err) diff --git a/libluna/include/luna/SystemError.h b/libluna/include/luna/SystemError.h index 2a8962f4..869f7a7f 100644 --- a/libluna/include/luna/SystemError.h +++ b/libluna/include/luna/SystemError.h @@ -53,14 +53,3 @@ #define EISCONN 106 // Transport endpoint is already connected #define ETIMEDOUT 110 // Connection timed out #define EALREADY 114 // Operation already in progress - -#if defined(IN_MOON) || defined(USE_FREESTANDING) || defined(_LUNA_SYSTEM_ERROR_EXTENSIONS) || defined(_LUNA_SOURCE) -// This one is Luna-specific. -#define EFIXME 342 // Functionality not yet implemented - -#ifndef _LUNA_SOURCE -const char* error_string(int error); -const char* error_name(int error); -#endif - -#endif diff --git a/libluna/src/SystemError.cpp b/libluna/src/SystemError.cpp index 5484a76f..9b7bf473 100644 --- a/libluna/src/SystemError.cpp +++ b/libluna/src/SystemError.cpp @@ -1,4 +1,3 @@ -#define _LUNA_SYSTEM_ERROR_EXTENSIONS #include const char* error_string(int error) @@ -57,7 +56,6 @@ const char* error_string(int error) case EISCONN: return "Transport endpoint is already connected"; case ETIMEDOUT: return "Connection timed out"; case EALREADY: return "Operation already in progress"; - case EFIXME: return "Functionality not yet implemented"; default: return "Unknown error"; } }