[uim-commit] r2934 - in branches/r5rs/sigscheme: . m4 src

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Jan 17 14:24:20 PST 2006


Author: yamaken
Date: 2006-01-17 14:24:16 -0800 (Tue, 17 Jan 2006)
New Revision: 2934

Added:
   branches/r5rs/sigscheme/m4/ax_c___attribute__.m4
Modified:
   branches/r5rs/sigscheme/configure.in
   branches/r5rs/sigscheme/m4/Makefile.am
   branches/r5rs/sigscheme/src/sigscheme.h
Log:
* sigscheme/m4/Makefile.am
  - (EXTRA_DIST): Add ax_c___attribute__.m4
* sigscheme/m4/ax_c___attribute__.m4
  - New file from the autoconf macro archive
* sigscheme/configure.in
  - Add AX_C___ATTRIBUTE__
* sigscheme/src/sigscheme.h
  - (SCM_NOINLINE, SCM_NORETURN): Enable by HAVE___ATTRIBUTE__ instead
    of __GNUC__


Modified: branches/r5rs/sigscheme/configure.in
===================================================================
--- branches/r5rs/sigscheme/configure.in	2006-01-17 22:14:43 UTC (rev 2933)
+++ branches/r5rs/sigscheme/configure.in	2006-01-17 22:24:16 UTC (rev 2934)
@@ -29,6 +29,8 @@
 AC_C_CHAR_UNSIGNED
 AC_C_BIGENDIAN
 AC_C_STRINGIZE
+AX_C___ATTRIBUTE__
+
 AC_TYPE_SIZE_T
 
 AC_CHECK_SIZEOF(short)

Modified: branches/r5rs/sigscheme/m4/Makefile.am
===================================================================
--- branches/r5rs/sigscheme/m4/Makefile.am	2006-01-17 22:14:43 UTC (rev 2933)
+++ branches/r5rs/sigscheme/m4/Makefile.am	2006-01-17 22:24:16 UTC (rev 2934)
@@ -1 +1,2 @@
-EXTRA_DIST = ax_check_page_aligned_malloc.m4
+EXTRA_DIST = ax_check_page_aligned_malloc.m4    \
+             ax_c___attribute__.m4

Added: branches/r5rs/sigscheme/m4/ax_c___attribute__.m4
===================================================================
--- branches/r5rs/sigscheme/m4/ax_c___attribute__.m4	2006-01-17 22:14:43 UTC (rev 2933)
+++ branches/r5rs/sigscheme/m4/ax_c___attribute__.m4	2006-01-17 22:24:16 UTC (rev 2934)
@@ -0,0 +1,30 @@
+dnl @synopsis AX_C___ATTRIBUTE__
+dnl
+dnl Provides a test for the compiler support of __attribute__
+dnl extensions. defines HAVE___ATTRIBUTE__ if it is found.
+dnl
+dnl Originating from the 'pork' package by Ryan McCabe <ryan at numb.org>
+dnl
+dnl @category C
+dnl @author Christian Haggstrom <chm at c00.info>
+dnl @version 2005-01-21
+dnl @license GPLWithACException
+
+AC_DEFUN([AX_C___ATTRIBUTE__], [
+  AC_MSG_CHECKING(for __attribute__)
+  AC_CACHE_VAL(ac_cv___attribute__, [
+    AC_TRY_COMPILE(
+      [#include <stdlib.h>],
+      [static void foo(void) __attribute__ ((unused));
+      static void
+      foo(void) {
+          exit(1);
+      }],
+      ac_cv___attribute__=yes,
+      ac_cv___attribute__=no
+    )])
+  if test "$ac_cv___attribute__" = "yes"; then
+    AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+  fi
+  AC_MSG_RESULT($ac_cv___attribute__)
+])

Modified: branches/r5rs/sigscheme/src/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/src/sigscheme.h	2006-01-17 22:14:43 UTC (rev 2933)
+++ branches/r5rs/sigscheme/src/sigscheme.h	2006-01-17 22:24:16 UTC (rev 2934)
@@ -38,6 +38,8 @@
 extern "C" {
 #endif
 
+#include "config.h"
+
 /*=======================================
    System Include
 =======================================*/
@@ -51,7 +53,6 @@
 /*=======================================
    Local Include
 =======================================*/
-#include "config.h"
 #include "encoding.h"
 
 /*=======================================
@@ -66,13 +67,13 @@
 
 /* FIXME: Confirm appropriate workaround about the noinline attribute vanishing
  * problem for Linux environments */
-#ifdef __GNUC__
+#if HAVE___ATTRIBUTE__
 #define SCM_NOINLINE __attribute__((noinline))
 #define SCM_NORETURN __attribute__((noreturn))
-#else
+#else /* HAVE___ATTRIBUTE__ */
 #define SCM_NOINLINE
 #define SCM_NORETURN
-#endif /* __GNUC__ */
+#endif /* HAVE___ATTRIBUTE__ */
 
 /* RFC: better names for the debug printing */
 #if SCM_DEBUG



More information about the uim-commit mailing list