summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2024-12-26 21:00:03 +0000
committerDavid Kalnischkies <david@kalnischkies.de>2025-01-05 22:16:08 +0000
commit9000543eb219f83b6b9592b681fc6811bc56e26f (patch)
tree722b028a46f9557df56e52c4283cb50857c2e5b8 /apt-pkg/contrib
parent81d6684a0c05c1232f853045b8f1eaa8cc1a782e (diff)
Drop APT_NORETURN usage
[[noreturn]] is a C++11 feature and so we can just use it unconditionally.
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/gpgv.cc2
-rw-r--r--apt-pkg/contrib/gpgv.h10
-rw-r--r--apt-pkg/contrib/macros.h7
3 files changed, 11 insertions, 8 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc
index 48d31a44c..59301fa0c 100644
--- a/apt-pkg/contrib/gpgv.cc
+++ b/apt-pkg/contrib/gpgv.cc
@@ -290,7 +290,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
bool const Debug = _config->FindB("Debug::Acquire::gpgv", false);
struct exiter {
std::vector<std::string> files;
- void operator ()(int code) APT_NORETURN {
+ [[noreturn]] void operator ()(int code) {
std::for_each(files.begin(), files.end(), [](auto f)
{ unlink(f.c_str()); });
exit(code);
diff --git a/apt-pkg/contrib/gpgv.h b/apt-pkg/contrib/gpgv.h
index 0b84f6bb7..f4f0a2ac7 100644
--- a/apt-pkg/contrib/gpgv.h
+++ b/apt-pkg/contrib/gpgv.h
@@ -47,11 +47,11 @@ APT_PUBLIC std::pair<std::string, std::forward_list<std::string>> FindGPGV(bool
* @param fd is used as a pipe for the standard output of gpgv
* @param key is the specific one to be used instead of using all
*/
-APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig,
- int const &statusfd, int fd[2], std::vector<std::string> const &KeyFiles) APT_NORETURN;
-APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig,
- int const &statusfd, int fd[2], std::string const &Key = "") APT_NORETURN;
-inline APT_NORETURN void ExecGPGV(std::string const &File, std::string const &FileSig,
+[[noreturn]] APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig,
+ int const &statusfd, int fd[2], std::vector<std::string> const &KeyFiles);
+[[noreturn]] APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig,
+ int const &statusfd, int fd[2], std::string const &Key = "");
+[[noreturn]] inline void ExecGPGV(std::string const &File, std::string const &FileSig,
int const &statusfd = -1) {
int fd[2];
ExecGPGV(File, FileSig, statusfd, fd);
diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h
index db4932969..c1fa73775 100644
--- a/apt-pkg/contrib/macros.h
+++ b/apt-pkg/contrib/macros.h
@@ -40,7 +40,6 @@
#define APT_DEPRECATED_MSG(X) __attribute__ ((deprecated(X)))
// __attribute__((const)) is too dangerous for us, we end up using it wrongly
#define APT_PURE __attribute__((pure))
- #define APT_NORETURN __attribute__((noreturn))
#define APT_PRINTF(n) __attribute__((format(printf, n, n + 1)))
#define APT_WEAK __attribute__((weak));
#define APT_UNUSED __attribute__((unused))
@@ -48,7 +47,6 @@
#define APT_DEPRECATED
#define APT_DEPRECATED_MSG
#define APT_PURE
- #define APT_NORETURN
#define APT_PRINTF(n)
#define APT_WEAK
#define APT_UNUSED
@@ -136,6 +134,11 @@ AptScopeWrapper(F) -> AptScopeWrapper<F>;
#define SETFLAG(v,f) ((v) |= FLAG(f))
#define CLRFLAG(v,f) ((v) &=~FLAG(f))
#define CHKFLAG(v,f) ((v) & FLAG(f) ? true : false)
+#if APT_GCC_VERSION >= 0x0300
+ #define APT_NORETURN __attribute__((noreturn))
+#else
+ #define APT_NORETURN
+#endif
#endif
#endif
#endif