1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:57:34 +00:00

Build: Get rid of the USERLAND define

Let's simplify things. There is now only KERNEL.
To see if you're on Serenity, check if __serenity__ is defined.
This commit is contained in:
Andreas Kling 2019-12-20 22:56:42 +01:00
parent 6c2c3d00a3
commit 44bc4008b7
4 changed files with 6 additions and 8 deletions

View file

@ -36,7 +36,7 @@ const LogStream& operator<<(const LogStream& stream, const void* value)
return stream << String::format("%p", value); return stream << String::format("%p", value);
} }
#ifdef USERLAND #if defined (__serenity__) && !defined(KERNEL)
static TriState got_process_name = TriState::Unknown; static TriState got_process_name = TriState::Unknown;
static char process_name_buffer[256]; static char process_name_buffer[256];
#endif #endif
@ -44,7 +44,7 @@ static char process_name_buffer[256];
DebugLogStream dbg() DebugLogStream dbg()
{ {
DebugLogStream stream; DebugLogStream stream;
#ifdef USERLAND #if defined (__serenity__) && !defined(KERNEL)
if (got_process_name == TriState::Unknown) { if (got_process_name == TriState::Unknown) {
if (get_process_name(process_name_buffer, sizeof(process_name_buffer)) == 0) if (get_process_name(process_name_buffer, sizeof(process_name_buffer)) == 0)
got_process_name = TriState::True; got_process_name = TriState::True;

View file

@ -3,7 +3,7 @@
#include <AK/Types.h> #include <AK/Types.h>
#include <AK/kstdio.h> #include <AK/kstdio.h>
#ifdef USERLAND #ifndef KERNEL
# include <AK/ScopedValueRollback.h> # include <AK/ScopedValueRollback.h>
# include <AK/StringView.h> # include <AK/StringView.h>
# include <errno.h> # include <errno.h>
@ -18,7 +18,7 @@ class StringView;
class LogStream { class LogStream {
public: public:
LogStream() LogStream()
#ifdef USERLAND #ifndef KERNEL
: m_errno_restorer(errno) : m_errno_restorer(errno)
#endif #endif
{ {
@ -28,7 +28,7 @@ public:
virtual void write(const char*, int) const = 0; virtual void write(const char*, int) const = 0;
private: private:
#ifdef USERLAND #ifndef KERNEL
ScopedValueRollback<int> m_errno_restorer; ScopedValueRollback<int> m_errno_restorer;
#endif #endif
}; };

View file

@ -11,7 +11,7 @@ void set_serial_debug(bool on_or_off);
int get_serial_debug(); int get_serial_debug();
} }
#ifndef USERLAND #ifdef KERNEL
# define printf dbgprintf # define printf dbgprintf
#endif #endif

View file

@ -54,8 +54,6 @@ else
ifdef KERNEL ifdef KERNEL
DEFINES += -DKERNEL DEFINES += -DKERNEL
else
DEFINES += -DUSERLAND
endif endif
OBJ_SUFFIX ?= OBJ_SUFFIX ?=