diff --git a/src/system/Error.hxx b/src/system/Error.hxx index aa017966b..c507656f6 100644 --- a/src/system/Error.hxx +++ b/src/system/Error.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 Max Kellermann + * Copyright 2013-2022 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,8 +27,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SYSTEM_ERROR_HXX -#define SYSTEM_ERROR_HXX +#pragma once #include // IWYU pragma: export #include @@ -104,6 +103,7 @@ FormatLastError(const char *fmt, Args&&... args) noexcept * * @see https://stackoverflow.com/questions/28746372/system-error-categories-and-standard-system-error-codes */ +[[gnu::const]] static inline const std::error_category & ErrnoCategory() noexcept { @@ -203,5 +203,3 @@ IsAccessDenied(const std::system_error &e) noexcept return IsErrno(e, EACCES); #endif } - -#endif