[geany/geany] 7ebcfb: Define gcc attributes inside gcc-attr.h

Jiří Techet git-noreply at xxxxx
Mon Dec 17 21:05:36 UTC 2018


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Sat, 08 Oct 2016 12:13:36 UTC
Commit:      7ebcfb77dca3accd06effb8f4698f8ab04ab5e8f
             https://github.com/geany/geany/commit/7ebcfb77dca3accd06effb8f4698f8ab04ab5e8f

Log Message:
-----------
Define gcc attributes inside gcc-attr.h


Modified Paths:
--------------
    ctags/Makefile.am
    ctags/main/gcc-attr.h
    ctags/main/general.h

Modified: ctags/Makefile.am
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -61,6 +61,7 @@ libctags_la_SOURCES = \
 	main/entry.h \
 	main/error.c \
 	main/error.h \
+	main/gcc-attr.h \
 	main/general.h \
 	main/keyword.c \
 	main/keyword.h \


Modified: ctags/main/gcc-attr.h
30 lines changed, 30 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,30 @@
+/*
+*   Copyright (c) 1998-2003, Darren Hiebert
+*
+*   This source code is released for free distribution under the terms of the
+*   GNU General Public License version 2 or (at your option) any later version.
+*/
+
+/* This is derived from general.h.
+   Only readtags related source file should include this.
+   ctags related source file should include genera.h instead. */
+
+#ifndef CTAGS_MAIN_GCC_ATTR_H
+#define CTAGS_MAIN_GCC_ATTR_H
+
+/*  Prevent warnings about unused variables in GCC. */
+#if defined (__GNUC__) && !defined (__GNUG__)
+# ifdef __MINGW32__
+#  define CTAGS_ATTR_UNUSED
+# else
+#  define CTAGS_ATTR_UNUSED __attribute__((unused))
+# endif
+# define CTAGS_ATTR_PRINTF(s,f)  __attribute__((format (printf, s, f)))
+# define attr__noreturn __attribute__((__noreturn__))
+#else
+# define CTAGS_ATTR_UNUSED
+# define CTAGS_ATTR_PRINTF(s,f)
+# define attr__noreturn
+#endif
+
+#endif	/* CTAGS_MAIN_GCC_ATTR_H */


Modified: ctags/main/general.h
13 lines changed, 1 insertions(+), 12 deletions(-)
===================================================================
@@ -27,18 +27,7 @@
 /*
 *   MACROS
 */
-
-/*  This is a helpful internal feature of later versions (> 2.7) of GCC
- *  to prevent warnings about unused variables.
- */
-#if (__GNUC__ > 2  ||  (__GNUC__ == 2  &&  __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
-# define CTAGS_ATTR_UNUSED __attribute__((unused))
-# define CTAGS_ATTR_PRINTF(s,f)  __attribute__((format (printf, s, f)))
-#else
-# define CTAGS_ATTR_UNUSED
-# define CTAGS_ATTR_PRINTF(s,f)
-#endif
-
+#include "gcc-attr.h"
 
 /*  MS-DOS doesn't allow manipulation of standard error, so we send it to
  *  stdout instead.



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list