/*
 * Copyright 2015 - 2025 gary@drinkingtea.net
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

#pragma once

#include "types.hpp"

#if __has_include(<cstddef>)
#include <cstddef>
#else
#define offsetof(type, member) __builtin_offsetof(type, member)

namespace std {
using ptrdiff_t = uintptr_t;
}
#endif

#ifdef _MSC_VER
#define OX_PACKED
#else
#define OX_PACKED __attribute__((packed))
#endif

#ifdef _MSC_VER
#define OX_ALIGN4
#else
#define OX_ALIGN4 __attribute__((aligned(4)))
#endif

#ifdef _MSC_VER
#define OX_ALIGN8
#else
#define OX_ALIGN8 __attribute__((aligned(8)))
#endif
