Skip to content

Commit ffd4592

Browse files
Dominik Loidoltgitster
authored andcommitted
compat/posix.h: clean up GIT_GNUC_PREREQ() and UNUSED
Fix the preprocessor indentation of the GIT_GNUC_PREREQ() and UNUSED macros according to the CodingGuidelines, without changing their behavior. Adjust the spelling in the GIT_GNUC_PREREQ() comment block. Signed-off-by: Dominik Loidolt <dominik.loidolt@univie.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 689dc92 commit ffd4592

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

compat/posix.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,23 @@
55

66
/*
77
* Derived from Linux "Features Test Macro" header
8-
* Convenience macros to test the versions of gcc (or
9-
* a compatible compiler).
8+
* Convenience macros to test the versions of GCC (or a compatible compiler).
109
* Use them like this:
1110
* #if GIT_GNUC_PREREQ (2,8)
12-
* ... code requiring gcc 2.8 or later ...
11+
* ... code requiring GCC 2.8 or later ...
1312
* #endif
1413
*
1514
* Note that Clang and other compilers define __GNUC__ for compatibility; use
1615
* GIT_CLANG_PREREQ() to check for specific Clang versions.
1716
*
1817
* This macro of course is not part of POSIX, but we need it for the UNUSED
1918
* macro which is used by some of our POSIX compatibility wrappers.
20-
*/
19+
*/
2120
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
2221
# define GIT_GNUC_PREREQ(maj, min) \
2322
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
2423
#else
25-
#define GIT_GNUC_PREREQ(maj, min) 0
24+
# define GIT_GNUC_PREREQ(maj, min) 0
2625
#endif
2726

2827
/* Similar for Clang. */
@@ -48,13 +47,13 @@
4847
* compilation, consider using MAYBE_UNUSED instead.
4948
*/
5049
#if GIT_GNUC_PREREQ(4, 5) || GIT_CLANG_PREREQ(2, 9)
51-
#define UNUSED __attribute__((unused)) \
52-
__attribute__((deprecated ("parameter declared as UNUSED")))
50+
# define UNUSED __attribute__((unused)) \
51+
__attribute__((deprecated("parameter declared as UNUSED")))
5352
#elif defined(__GNUC__)
54-
#define UNUSED __attribute__((unused)) \
53+
# define UNUSED __attribute__((unused)) \
5554
__attribute__((deprecated))
5655
#else
57-
#define UNUSED
56+
# define UNUSED
5857
#endif
5958

6059
#ifdef __MINGW64__

0 commit comments

Comments
 (0)