Skip to content

Commit d5a51b0

Browse files
committed
cleanup: Use tox_attributes.h in tox_private.h and install it.
Only when using experimental APIs.
1 parent b6f5b9f commit d5a51b0

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ genrule(
1818
outs = [
1919
"tox/toxav.h",
2020
"tox/tox.h",
21+
"tox/tox_attributes.h",
2122
"tox/tox_dispatch.h",
2223
"tox/tox_events.h",
2324
"tox/tox_log_level.h",

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ set(toxcore_API_HEADERS
391391
${toxcore_SOURCE_DIR}/toxcore/tox_options.h^tox)
392392
if(EXPERIMENTAL_API)
393393
set(toxcore_API_HEADERS ${toxcore_API_HEADERS}
394+
${toxcore_SOURCE_DIR}/toxcore/tox_attributes.h^tox
394395
${toxcore_SOURCE_DIR}/toxcore/tox_dispatch.h^tox
395396
${toxcore_SOURCE_DIR}/toxcore/tox_events.h^tox
396397
${toxcore_SOURCE_DIR}/toxcore/tox_private.h^tox

toxcore/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
44
exports_files(
55
srcs = [
66
"tox.h",
7+
"tox_attributes.h",
78
"tox_dispatch.h",
89
"tox_events.h",
910
"tox_log_level.h",
@@ -1318,6 +1319,7 @@ cc_library(
13181319
":os_memory",
13191320
":os_random",
13201321
":state",
1322+
":tox_attributes",
13211323
":tox_log_level",
13221324
":tox_options",
13231325
":util",

toxcore/tox_attributes.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
/* SPDX-License-Identifier: GPL-3.0-or-later
2-
* Copyright © 2022-2025 The TokTok team.
2+
* Copyright © 2022-2026 The TokTok team.
33
*/
44

55
/**
66
* nonnull attributes for GCC/Clang and Cimple.
7-
*
8-
* This file is a modified version of c-toxcore/toxcore/attributes.h with a
9-
* `tox_` prefix added to the macros to avoid conflicts with client code.
107
*/
118
#ifndef C_TOXCORE_TOXCORE_TOX_ATTRIBUTES_H
129
#define C_TOXCORE_TOXCORE_TOX_ATTRIBUTES_H
@@ -20,12 +17,6 @@
2017
#define _Nullable
2118
#endif
2219

23-
#ifdef SPARSE
24-
#define tox_bitwise __attribute__((bitwise))
25-
#else
26-
#define tox_bitwise
27-
#endif
28-
2920
//!TOKSTYLE+
3021

3122
#endif /* C_TOXCORE_TOXCORE_TOX_ATTRIBUTES_H */

toxcore/tox_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <stddef.h>
1111
#include <stdint.h>
1212

13-
#include "attributes.h"
1413
#include "tox.h"
14+
#include "tox_attributes.h"
1515
#include "tox_options.h"
1616

1717
#ifdef __cplusplus

0 commit comments

Comments
 (0)