Skip to content

Commit

Permalink
Build: Get rid of the USERLAND define
Browse files Browse the repository at this point in the history
Let's simplify things. There is now only KERNEL.
To see if you're on Serenity, check if __serenity__ is defined.
  • Loading branch information
awesomekling committed Dec 20, 2019
1 parent 6c2c3d0 commit 44bc400
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions AK/LogStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ const LogStream& operator<<(const LogStream& stream, const void* value)
return stream << String::format("%p", value);
}

#ifdef USERLAND
#if defined (__serenity__) && !defined(KERNEL)
static TriState got_process_name = TriState::Unknown;
static char process_name_buffer[256];
#endif

DebugLogStream dbg()
{
DebugLogStream stream;
#ifdef USERLAND
#if defined (__serenity__) && !defined(KERNEL)
if (got_process_name == TriState::Unknown) {
if (get_process_name(process_name_buffer, sizeof(process_name_buffer)) == 0)
got_process_name = TriState::True;
Expand Down
6 changes: 3 additions & 3 deletions AK/LogStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <AK/Types.h>
#include <AK/kstdio.h>

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

private:
#ifdef USERLAND
#ifndef KERNEL
ScopedValueRollback<int> m_errno_restorer;
#endif
};
Expand Down
2 changes: 1 addition & 1 deletion Kernel/kstdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void set_serial_debug(bool on_or_off);
int get_serial_debug();
}

#ifndef USERLAND
#ifdef KERNEL
# define printf dbgprintf
#endif

Expand Down
2 changes: 0 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ else

ifdef KERNEL
DEFINES += -DKERNEL
else
DEFINES += -DUSERLAND
endif

OBJ_SUFFIX ?=
Expand Down

0 comments on commit 44bc400

Please sign in to comment.