Crafter.Build/tests/IncrementalHeaderChange/fixture/lib/Widget.cppm

21 lines
830 B
Text
Raw Normal View History

// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
module;
// The whole point of the fixture: an input to this interface unit that the
// module scanner cannot see. WIDGET_SLOTS comes from a header, so the class
// layout below changes without Widget.cppm being touched.
#include "widget-layout.h"
export module Widget;
import std;
export struct Widget {
std::array<std::int64_t, WIDGET_SLOTS> slots;
};
// Out-of-line in the library's implementation unit, so the value reflects the
// layout the *library* was compiled against rather than the caller's — same
// reasoning as the IncrementalInterfaceChange fixture.
export std::size_t WidgetSizeInLibrary();
// Reads a macro from a header only the implementation unit includes.
export std::int64_t WidgetCountInLibrary();