]> git.ipfire.org Git - thirdparty/git.git/commitdiff
compat/posix.h: clean up GIT_GNUC_PREREQ() and UNUSED
authorDominik Loidolt <dominik.loidolt@univie.ac.at>
Sat, 13 Jun 2026 12:27:10 +0000 (14:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 13 Jun 2026 15:45:26 +0000 (08:45 -0700)
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>
compat/posix.h

index 273cb871013c6d4d623a4b8f7e2446a840d63d20..d2de5cedf5367e8311390cc0c54b80b35f8458fc 100644 (file)
@@ -5,11 +5,10 @@
 
 /*
  * Derived from Linux "Features Test Macro" header
- * Convenience macros to test the versions of gcc (or
- * a compatible compiler).
+ * Convenience macros to test the versions of GCC (or a compatible compiler).
  * Use them like this:
  *  #if GIT_GNUC_PREREQ (2,8)
- *   ... code requiring gcc 2.8 or later ...
+ *   ... code requiring GCC 2.8 or later ...
  *  #endif
  *
  * Note that Clang and other compilers define __GNUC__ for compatibility; use
  *
  * This macro of course is not part of POSIX, but we need it for the UNUSED
  * macro which is used by some of our POSIX compatibility wrappers.
-*/
+ */
 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
 # define GIT_GNUC_PREREQ(maj, min) \
        ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
 #else
- #define GIT_GNUC_PREREQ(maj, min) 0
+define GIT_GNUC_PREREQ(maj, min) 0
 #endif
 
 /* Similar for Clang. */
  * compilation, consider using MAYBE_UNUSED instead.
  */
 #if GIT_GNUC_PREREQ(4, 5) || GIT_CLANG_PREREQ(2, 9)
-#define UNUSED __attribute__((unused)) \
-       __attribute__((deprecated ("parameter declared as UNUSED")))
+# define UNUSED __attribute__((unused)) \
+       __attribute__((deprecated("parameter declared as UNUSED")))
 #elif defined(__GNUC__)
-#define UNUSED __attribute__((unused)) \
+# define UNUSED __attribute__((unused)) \
        __attribute__((deprecated))
 #else
-#define UNUSED
+# define UNUSED
 #endif
 
 #ifdef __MINGW64__