From: Joel Rosdahl Date: Tue, 4 Aug 2020 09:43:55 +0000 (+0200) Subject: Clean up system.hpp X-Git-Tag: v4.0~224 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14738b02a35bd28c9e4d1f541e30f26db0664515;p=thirdparty%2Fccache.git Clean up system.hpp --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 522876234..cdc1f817c 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -174,10 +174,10 @@ add_prefix(const Context& ctx, Args& args, const std::string& prefix_command) // If `exit_code` is set, just exit with that code directly, otherwise execute // the real compiler and exit with its exit code. Also updates statistics // counter `stat` if it's not STATS_NONE. -static void failed(enum stats stat = STATS_NONE, - optional exit_code = nullopt) ATTR_NORETURN; +[[noreturn]] static void failed(enum stats stat = STATS_NONE, + optional exit_code = nullopt); -static void +[[noreturn]] static void failed(enum stats stat, optional exit_code) { throw Failure(stat, exit_code); diff --git a/src/system.hpp b/src/system.hpp index 789eaefc8..788123a79 100644 --- a/src/system.hpp +++ b/src/system.hpp @@ -21,9 +21,6 @@ #ifdef __MINGW32__ # define __USE_MINGW_ANSI_STDIO 1 # define __STDC_FORMAT_MACROS 1 -# define ATTRIBUTE_FORMAT_PRINTF __MINGW_PRINTF_FORMAT -#else -# define ATTRIBUTE_FORMAT_PRINTF printf #endif #include "config.h" @@ -65,19 +62,10 @@ extern int usleep(useconds_t); extern char** environ; -#ifdef __GNUC__ -# define ATTR_FORMAT(x, y, z) \ - __attribute__((format(ATTRIBUTE_FORMAT_PRINTF, y, z))) -# define ATTR_NORETURN __attribute__((noreturn)) -#else -# define ATTR_FORMAT(x, y, z) -# define ATTR_NORETURN -#endif - #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) // Buffer size for I/O operations. Should be a multiple of 4 KiB. -#define READ_BUFFER_SIZE 65536 +const size_t READ_BUFFER_SIZE = 65536; #ifndef ESTALE # define ESTALE -1 @@ -94,8 +82,6 @@ extern char** environ; # define execv(a, b) win32execute(a, b, 0, -1, -1) # define DIR_DELIM_CH '\\' # define PATH_DELIM ";" -# define F_RDLCK 0 -# define F_WRLCK 0 #else # define DIR_DELIM_CH '/' # define PATH_DELIM ":"