GenerateExportHeader: use C++11 attributes if available

The minimum compiler versions were determined in the GCC and LLVM
repositories as follows. The first release containing a commit is the
lowest release tag listed by ``git tag --contains <commit>``. Since a
point release of an older series can be listed although it lacks the
commit, ``git grep`` at the tag confirms the change.

1. The header requires __has_cpp_attribute to accept scoped names such
   as gnu::visibility.  The commit adding this is the oldest one whose
   diff touches a line parsing the "::" token:

     gcc$ git log --reverse --format=%H -G'CPP_SCOPE' \
            -- gcc/c-family/c-lex.c
     llvm-project$ git log --reverse --format=%H \
            -G'Ident__has_cpp_attribute.*coloncolon' -- clang/lib/Lex

   This yields 42fd12b1e7fc50183bcf62861aae81301a9efbcf in
   releases/gcc-5.1.0 and a0344c5d7b9b748a2244dce393ceb55e83b495d6 in
   llvmorg-3.6.0.

2. The GCC commit accepting mixed attribute spellings references its bug
   https://gcc.gnu.org/PR69585 in the message:

     gcc$ git log --format=%H --grep=c++/69585

   This yields aec868578d8515763d75693c1fdfbc30ff0a1e68 in
   releases/gcc-13.1.0.

Fixes: #22908
Issue: #20527
This commit is contained in:
Sergiu Deitsch committed 2026-10-28 20:13:16 +01:00
1 parent cfb3000e9e
commit 1e5e049c02
20 files changed
+824 -6

No files matched your search

@@ -0,0 +1,8 @@
GenerateExportHeader-cxx-attributes
-----------------------------------
* The :module:`GenerateExportHeader` module's
:command:`generate_export_header` command gained a ``CXX_ATTRIBUTES``
option to define the export, no-export and deprecation macros as C++11
attributes, which, unlike the compiler-specific spellings, can be combined
with other C++11 attributes.
+97 -1
View File
@@ -68,6 +68,7 @@ Generating Export Header
[PREFIX_NAME <prefix>]
[CUSTOM_CONTENT_FROM_VARIABLE <variable>]
[INCLUDE_GUARD_NAME <include-guard-name>]
[CXX_ATTRIBUTES]
)
By default, this command generates a header file named
@@ -190,6 +191,46 @@ Generating Export Header
// ...
#endif /* <include-guard-name> */
``CXX_ATTRIBUTES``
.. versionadded:: 4.6
If specified, the export, no-export and deprecation macros expand to
C++11 attributes, such as ``[[gnu::visibility("default")]]``,
``[[gnu::dllexport]]`` and ``[[gnu::deprecated]]``, which can be
combined with other C++11 attributes. The generated header falls back
to the compiler-specific spellings, such as ``__attribute__`` and
``__declspec``, if the consumer compiles C, compiles C++ older than
C++11, does not support the attribute, or is Qt's ``moc``. The
fallback is decided by the preprocessor, so the header remains usable
by consumers using a different compiler. The C++11 attributes are used
with GCC 5 and Clang 3.6 or newer. This matters for GCC versions before
13, which reject the compiler-specific spellings combined with C++11
attributes, such as ``struct EXAMPLE_EXPORT [[nodiscard]] Struct``.
A C++11 attribute that follows a type applies to the type, not to the
declared symbol. The macros must therefore be placed at the start of a
declaration or right after the class key. Otherwise, compilers either
reject the declaration or ignore the attribute and do not export the
symbol:
.. code-block:: c++
class EXAMPLE_EXPORT Class
{
public:
EXAMPLE_NO_EXPORT int method_excluded() const;
EXAMPLE_EXPORT static int const data_exported;
};
EXAMPLE_EXPORT int function_exported();
EXAMPLE_DEPRECATED_EXPORT int function_deprecated();
EXAMPLE_EXPORT extern int const data_exported;
int EXAMPLE_EXPORT function_not_exported(); // wrong placement
The compiler-specific spellings accept the same placement, so the
declarations compile with either.
Deprecated Command
""""""""""""""""""
@@ -564,6 +605,10 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
set(DEFINE_EXPORT)
set(DEFINE_IMPORT)
set(DEFINE_NO_EXPORT)
set(CXX_ATTRIBUTE_DEPRECATED "gnu::deprecated")
set(CXX_ATTRIBUTE_EXPORT)
set(CXX_ATTRIBUTE_IMPORT)
set(CXX_ATTRIBUTE_NO_EXPORT)
if (COMPILER_HAS_DEPRECATED_ATTR AND NOT WIN32)
set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))")
@@ -577,17 +622,47 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
if(WIN32 OR CYGWIN)
set(DEFINE_EXPORT "__declspec(dllexport)")
set(DEFINE_IMPORT "__declspec(dllimport)")
set(CXX_ATTRIBUTE_EXPORT "gnu::dllexport")
set(CXX_ATTRIBUTE_IMPORT "gnu::dllimport")
elseif(COMPILER_HAS_HIDDEN_VISIBILITY)
set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))")
set(CXX_ATTRIBUTE_EXPORT "gnu::visibility(\"default\")")
set(CXX_ATTRIBUTE_IMPORT "gnu::visibility(\"default\")")
set(CXX_ATTRIBUTE_NO_EXPORT "gnu::visibility(\"hidden\")")
endif()
endif()
endmacro()
# Sets <out> to the preprocessor lines indented by <indent> that define the
# macro <name> as <value>. Given a C++11 <attribute>, the lines prefer
# [[<attribute>]] in consumers that support it and fall back to <value>
# otherwise. Qt's moc always sees <value> because older versions of moc skip
# classes declared with C++11 attributes.
function(_generate_export_header_definition out indent name value attribute)
if(NOT attribute)
set(${out} "#${indent}define ${name} ${value}" PARENT_SCOPE)
return()
endif()
string(REGEX REPLACE "\\(.*" "" token "${attribute}")
string(JOIN "\n" definition
"#${indent}if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)"
"#${indent} if __has_cpp_attribute(${token})"
"#${indent} define ${name} [[${attribute}]]"
"#${indent} endif"
"#${indent}endif"
"#${indent}ifndef ${name}"
"#${indent} define ${name} ${value}"
"#${indent}endif"
)
set(${out} "${definition}" PARENT_SCOPE)
endfunction()
function(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
# Option overrides
set(options DEFINE_NO_DEPRECATED)
set(options DEFINE_NO_DEPRECATED CXX_ATTRIBUTES)
set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE
NO_DEPRECATED_MACRO_NAME CUSTOM_CONTENT_FROM_VARIABLE INCLUDE_GUARD_NAME)
@@ -675,6 +750,27 @@ function(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
endif()
endif()
if(NOT _GEH_CXX_ATTRIBUTES)
set(CXX_ATTRIBUTE_DEPRECATED)
set(CXX_ATTRIBUTE_EXPORT)
set(CXX_ATTRIBUTE_IMPORT)
set(CXX_ATTRIBUTE_NO_EXPORT)
endif()
_generate_export_header_definition(EXPORT_DEFINITION " "
"${EXPORT_MACRO_NAME}" "${DEFINE_EXPORT}" "${CXX_ATTRIBUTE_EXPORT}")
_generate_export_header_definition(IMPORT_DEFINITION " "
"${EXPORT_MACRO_NAME}" "${DEFINE_IMPORT}" "${CXX_ATTRIBUTE_IMPORT}")
_generate_export_header_definition(NO_EXPORT_DEFINITION " "
"${NO_EXPORT_MACRO_NAME}" "${DEFINE_NO_EXPORT}"
"${CXX_ATTRIBUTE_NO_EXPORT}")
# The GNU spelling of deprecation shares the availability of the export
# attributes, so that the combined macros never mix C++11 attributes with
# the legacy spellings, which Clang rejects after __declspec.
_generate_export_header_definition(DEPRECATED_DEFINITION " "
"${DEPRECATED_MACRO_NAME}" "${DEFINE_DEPRECATED}"
"${CXX_ATTRIBUTE_DEPRECATED}")
configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/exportheader.cmake.in"
"${EXPORT_FILE_NAME}" @ONLY)
endfunction()
+4 -4
View File
@@ -9,20 +9,20 @@
# ifndef @EXPORT_MACRO_NAME@
# ifdef @EXPORT_IMPORT_CONDITION@
/* We are building this library */
# define @EXPORT_MACRO_NAME@ @DEFINE_EXPORT@
@EXPORT_DEFINITION@
# else
/* We are using this library */
# define @EXPORT_MACRO_NAME@ @DEFINE_IMPORT@
@IMPORT_DEFINITION@
# endif
# endif
# ifndef @NO_EXPORT_MACRO_NAME@
# define @NO_EXPORT_MACRO_NAME@ @DEFINE_NO_EXPORT@
@NO_EXPORT_DEFINITION@
# endif
#endif
#ifndef @DEPRECATED_MACRO_NAME@
# define @DEPRECATED_MACRO_NAME@ @DEFINE_DEPRECATED@
@DEPRECATED_DEFINITION@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_EXPORT
+1 -1
View File
@@ -4,6 +4,6 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library(libB SHARED libB.cpp)
generate_export_header(libB)
generate_export_header(libB CXX_ATTRIBUTES)
target_link_libraries(libB LINK_PUBLIC libA)
@@ -76,6 +76,7 @@ endmacro()
macro_add_test_library(libshared)
macro_add_test_library(libstatic)
macro_add_test_library(libattributes)
add_subdirectory(nodeprecated)
add_subdirectory(includeguard)
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include "libattributes.h"
#include "libshared.h"
#include "libstatic.h"
@@ -164,11 +165,46 @@ int main()
use_int(libstatic::data_exported);
use_int(libstatic::data_excluded);
{
libattributes::Class l;
// l.method(); LINK ERROR
l.method_exported();
l.method_deprecated_exported();
// l.method_excluded(); LINK ERROR
// use_int(l.data); LINK ERROR
use_int(l.data_exported);
// use_int(l.data_excluded); LINK ERROR
}
{
libattributes::ExportedClass l;
l.method();
#if defined(_WIN32) || defined(__CYGWIN__)
l.method_excluded();
#else
// l.method_excluded(); LINK ERROR (NOT WIN32 AND NOT CYGWIN)
#endif
}
// libattributes::function(); LINK ERROR
libattributes::function_exported();
libattributes::function_deprecated_exported();
// libattributes::function_excluded(); LINK ERROR
// use_int(libattributes::data); LINK ERROR
use_int(libattributes::data_exported);
// use_int(libattributes::data_excluded); LINK ERROR
libattributes_function_c();
#if defined(SRC_DIR) && defined(BIN_DIR)
compare(SRC_DIR "/libshared_export.h",
BIN_DIR "/libshared/libshared_export.h");
compare(SRC_DIR "/libstatic_export.h",
BIN_DIR "/libstatic/libstatic_export.h");
compare(SRC_DIR "/libattributes_export.h",
BIN_DIR "/libattributes/libattributes_export.h");
#endif
return 0;
@@ -0,0 +1,37 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(GenerateExportHeader)
# Show that the export header defined with C++11 attributes exports and hides
# symbols declared with the macros in leading position.
add_library(libattributes SHARED libattributes.cpp)
generate_export_header(libattributes CXX_ATTRIBUTES)
# Show that consumers in language modes without C++11 attributes fall back to
# the compiler-specific spelling. Generators such as FASTBuild compile the
# output of the Clang preprocessor, whose line markers are a GNU extension.
set(no_line_marker_errors
$<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang>:-Wno-gnu-line-marker>
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-gnu-line-marker>
)
if(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
add_executable(libattributes_c main.c)
set_property(TARGET libattributes_c PROPERTY C_STANDARD 99)
target_compile_options(libattributes_c PRIVATE
-pedantic-errors ${no_line_marker_errors})
target_link_libraries(libattributes_c PRIVATE libattributes)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
add_executable(libattributes_cxx98 main.cpp)
set_target_properties(libattributes_cxx98 PROPERTIES
CXX_STANDARD 98
CXX_EXTENSIONS OFF
)
target_compile_options(libattributes_cxx98 PRIVATE
-pedantic-errors ${no_line_marker_errors})
target_link_libraries(libattributes_cxx98 PRIVATE libattributes)
endif()
@@ -0,0 +1,68 @@
#include "libattributes.h"
int libattributes::Class::method() const
{
return 0;
}
int libattributes::Class::method_exported() const
{
return 0;
}
int libattributes::Class::method_deprecated_exported() const
{
return 0;
}
int libattributes::Class::method_excluded() const
{
return 0;
}
int const libattributes::Class::data = 1;
int const libattributes::Class::data_exported = 1;
int const libattributes::Class::data_excluded = 1;
int libattributes::ExportedClass::method() const
{
return 0;
}
int libattributes::ExportedClass::method_excluded() const
{
return 0;
}
int libattributes::function()
{
return 0;
}
int libattributes::function_exported()
{
return 0;
}
int libattributes::function_deprecated_exported()
{
return 0;
}
int libattributes::function_excluded()
{
return 0;
}
int const libattributes::data = 1;
int const libattributes::data_exported = 1;
int const libattributes::data_excluded = 1;
int libattributes_function_c(void)
{
return 0;
}
@@ -0,0 +1,51 @@
#ifndef LIBATTRIBUTES_H
#define LIBATTRIBUTES_H
#include "libattributes_c.h"
#include "libattributes_export.h"
namespace libattributes {
class Class
{
public:
int method() const;
LIBATTRIBUTES_EXPORT int method_exported() const;
LIBATTRIBUTES_DEPRECATED_EXPORT int method_deprecated_exported() const;
LIBATTRIBUTES_NO_EXPORT int method_excluded() const;
static int const data;
LIBATTRIBUTES_EXPORT static int const data_exported;
LIBATTRIBUTES_NO_EXPORT static int const data_excluded;
};
class LIBATTRIBUTES_EXPORT ExportedClass
{
public:
int method() const;
LIBATTRIBUTES_NO_EXPORT int method_excluded() const;
};
int function();
LIBATTRIBUTES_EXPORT int function_exported();
LIBATTRIBUTES_DEPRECATED_EXPORT int function_deprecated_exported();
LIBATTRIBUTES_NO_EXPORT int function_excluded();
extern int const data;
LIBATTRIBUTES_EXPORT extern int const data_exported;
LIBATTRIBUTES_NO_EXPORT extern int const data_excluded;
} // namespace libattributes
#endif
@@ -0,0 +1,16 @@
#ifndef LIBATTRIBUTES_C_H
#define LIBATTRIBUTES_C_H
#include "libattributes_export.h"
#ifdef __cplusplus
extern "C" {
#endif
LIBATTRIBUTES_EXPORT int libattributes_function_c(void);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,6 @@
#include "libattributes_c.h"
int main(void)
{
return libattributes_function_c();
}
@@ -0,0 +1,8 @@
#include "libattributes.h"
int main()
{
libattributes::Class l;
return l.method_exported() + libattributes::function_exported() +
libattributes::data_exported - 1;
}
@@ -0,0 +1,64 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllexport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllexport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllexport)
# endif
# else
/* We are using this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllimport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllimport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllimport)
# endif
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED __attribute__ ((__deprecated__))
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,50 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# define LIBATTRIBUTES_EXPORT
# else
/* We are using this library */
# define LIBATTRIBUTES_EXPORT
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,64 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllexport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllexport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllexport)
# endif
# else
/* We are using this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllimport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllimport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllimport)
# endif
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED __declspec(deprecated)
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,71 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::visibility)
# define LIBATTRIBUTES_EXPORT [[gnu::visibility("default")]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __attribute__((visibility("default")))
# endif
# else
/* We are using this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::visibility)
# define LIBATTRIBUTES_EXPORT [[gnu::visibility("default")]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __attribute__((visibility("default")))
# endif
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::visibility)
# define LIBATTRIBUTES_NO_EXPORT [[gnu::visibility("hidden")]]
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT __attribute__((visibility("hidden")))
# endif
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED __attribute__ ((__deprecated__))
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,50 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# define LIBATTRIBUTES_EXPORT
# else
/* We are using this library */
# define LIBATTRIBUTES_EXPORT
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED __attribute__ ((__deprecated__))
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,64 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllexport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllexport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllexport)
# endif
# else
/* We are using this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllimport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllimport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllimport)
# endif
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED __declspec(deprecated)
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,64 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllexport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllexport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllexport)
# endif
# else
/* We are using this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllimport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllimport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllimport)
# endif
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED __declspec(deprecated)
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */
@@ -0,0 +1,64 @@
#ifndef LIBATTRIBUTES_EXPORT_H
#define LIBATTRIBUTES_EXPORT_H
#ifdef LIBATTRIBUTES_STATIC_DEFINE
# define LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
#else
# ifndef LIBATTRIBUTES_EXPORT
# ifdef libattributes_EXPORTS
/* We are building this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllexport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllexport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllexport)
# endif
# else
/* We are using this library */
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::dllimport)
# define LIBATTRIBUTES_EXPORT [[gnu::dllimport]]
# endif
# endif
# ifndef LIBATTRIBUTES_EXPORT
# define LIBATTRIBUTES_EXPORT __declspec(dllimport)
# endif
# endif
# endif
# ifndef LIBATTRIBUTES_NO_EXPORT
# define LIBATTRIBUTES_NO_EXPORT
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED
# if defined(__cplusplus) && __cplusplus >= 201103L && defined(__has_cpp_attribute) && !defined(Q_MOC_RUN)
# if __has_cpp_attribute(gnu::deprecated)
# define LIBATTRIBUTES_DEPRECATED [[gnu::deprecated]]
# endif
# endif
# ifndef LIBATTRIBUTES_DEPRECATED
# define LIBATTRIBUTES_DEPRECATED
# endif
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_EXPORT
# define LIBATTRIBUTES_DEPRECATED_EXPORT LIBATTRIBUTES_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
#ifndef LIBATTRIBUTES_DEPRECATED_NO_EXPORT
# define LIBATTRIBUTES_DEPRECATED_NO_EXPORT LIBATTRIBUTES_NO_EXPORT LIBATTRIBUTES_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef LIBATTRIBUTES_NO_DEPRECATED
# define LIBATTRIBUTES_NO_DEPRECATED
# endif
#endif
#endif /* LIBATTRIBUTES_EXPORT_H */