libluna: Remove EFIXME and make others declare error_string() and error_name()

Closes #26.
This commit is contained in:
apio 2023-05-02 10:46:18 +02:00
parent 7058ec945a
commit 052ae4902e
Signed by: apio
GPG Key ID: B8A7D06E42258954
4 changed files with 4 additions and 15 deletions

View File

@ -1,4 +1,3 @@
#define _LUNA_SYSTEM_ERROR_EXTENSIONS
#include <luna/SystemError.h>
#include <string.h>
@ -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<char*>(error_string(errnum));

View File

@ -1,5 +1,4 @@
#pragma once
#define _LUNA_SYSTEM_ERROR_EXTENSIONS
#include <luna/Check.h>
#include <luna/Move.h>
#include <luna/Option.h>
@ -7,6 +6,8 @@
#include <luna/SystemError.h>
#include <luna/Types.h>
extern const char* error_string(int error);
struct Error
{
Error(int err)

View File

@ -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

View File

@ -1,4 +1,3 @@
#define _LUNA_SYSTEM_ERROR_EXTENSIONS
#include <luna/SystemError.h>
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";
}
}