mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibSQL: Resolve cyclic dependency
Previously, class SQL::Key
depends on def class SQL::IndexDef (because inline def index())
depends on def class SQL::KeyPartDef (inline def key_definition())
depends on def class SQL::ColumnDef (because base class)
depends on def class SQL::Relation (because base class)
depends on def class SQL::Key (because inline def hash()).
This hasn't caused any problems so far because Meta.h happened to be
always included after Key.h (in part due to alphabetical ordering).
However, a compilation that for example only contains
#include <Userland/Libraries/LibSQL/Key.h>
would fail to compile.
This patch resolves this issue by pushing the inline definition of
SQL::Relation::hash() into a different file. Yes, this might reduce
performance marginally, but this gets it to compile again.
This commit is contained in:
committed by
Linus Groh
parent
a95b321bf1
commit
9d89b64d59
@@ -14,8 +14,8 @@
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibSQL/Forward.h>
|
||||
#include <LibSQL/Key.h>
|
||||
#include <LibSQL/Type.h>
|
||||
#include <LibSQL/Value.h>
|
||||
|
||||
namespace SQL {
|
||||
|
||||
@@ -28,7 +28,7 @@ class Relation : public Core::Object {
|
||||
C_OBJECT_ABSTRACT(Relation);
|
||||
|
||||
public:
|
||||
u32 hash() const { return key().hash(); }
|
||||
u32 hash() const;
|
||||
u32 pointer() const { return m_pointer; }
|
||||
void set_pointer(u32 pointer) { m_pointer = pointer; }
|
||||
~Relation() override = default;
|
||||
|
||||
Reference in New Issue
Block a user