From d5a51b09a239ce2c99adf4d429673a0add7e266b Mon Sep 17 00:00:00 2001 From: iphydf Date: Tue, 13 Jan 2026 22:56:30 +0000 Subject: [PATCH] cleanup: Use tox_attributes.h in tox_private.h and install it. Only when using experimental APIs. --- BUILD.bazel | 1 + CMakeLists.txt | 1 + toxcore/BUILD.bazel | 2 ++ toxcore/tox_attributes.h | 11 +---------- toxcore/tox_private.h | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index a5c465af3..6e98e76d0 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -18,6 +18,7 @@ genrule( outs = [ "tox/toxav.h", "tox/tox.h", + "tox/tox_attributes.h", "tox/tox_dispatch.h", "tox/tox_events.h", "tox/tox_log_level.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 143efbae4..725e0d90f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -391,6 +391,7 @@ set(toxcore_API_HEADERS ${toxcore_SOURCE_DIR}/toxcore/tox_options.h^tox) if(EXPERIMENTAL_API) set(toxcore_API_HEADERS ${toxcore_API_HEADERS} + ${toxcore_SOURCE_DIR}/toxcore/tox_attributes.h^tox ${toxcore_SOURCE_DIR}/toxcore/tox_dispatch.h^tox ${toxcore_SOURCE_DIR}/toxcore/tox_events.h^tox ${toxcore_SOURCE_DIR}/toxcore/tox_private.h^tox diff --git a/toxcore/BUILD.bazel b/toxcore/BUILD.bazel index cd3e8ee5e..2aaa31f6c 100644 --- a/toxcore/BUILD.bazel +++ b/toxcore/BUILD.bazel @@ -4,6 +4,7 @@ load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test") exports_files( srcs = [ "tox.h", + "tox_attributes.h", "tox_dispatch.h", "tox_events.h", "tox_log_level.h", @@ -1318,6 +1319,7 @@ cc_library( ":os_memory", ":os_random", ":state", + ":tox_attributes", ":tox_log_level", ":tox_options", ":util", diff --git a/toxcore/tox_attributes.h b/toxcore/tox_attributes.h index fa646db0c..2f868f7d9 100644 --- a/toxcore/tox_attributes.h +++ b/toxcore/tox_attributes.h @@ -1,12 +1,9 @@ /* SPDX-License-Identifier: GPL-3.0-or-later - * Copyright © 2022-2025 The TokTok team. + * Copyright © 2022-2026 The TokTok team. */ /** * nonnull attributes for GCC/Clang and Cimple. - * - * This file is a modified version of c-toxcore/toxcore/attributes.h with a - * `tox_` prefix added to the macros to avoid conflicts with client code. */ #ifndef C_TOXCORE_TOXCORE_TOX_ATTRIBUTES_H #define C_TOXCORE_TOXCORE_TOX_ATTRIBUTES_H @@ -20,12 +17,6 @@ #define _Nullable #endif -#ifdef SPARSE -#define tox_bitwise __attribute__((bitwise)) -#else -#define tox_bitwise -#endif - //!TOKSTYLE+ #endif /* C_TOXCORE_TOXCORE_TOX_ATTRIBUTES_H */ diff --git a/toxcore/tox_private.h b/toxcore/tox_private.h index a23674ec3..d5713d58a 100644 --- a/toxcore/tox_private.h +++ b/toxcore/tox_private.h @@ -10,8 +10,8 @@ #include #include -#include "attributes.h" #include "tox.h" +#include "tox_attributes.h" #include "tox_options.h" #ifdef __cplusplus