2009-09-26 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Sat, 26 Sep 2009 15:43:34 +0000 (15:43 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:48 +0000 (21:06 +0400)
* allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
with GC_INLINE.
* include/private/gc_priv.h (fixed_getenv): Ditto.
* alloc.c (GC_max, GC_min): Replace "static INLINE" with
GC_INLINE.
* mark_rts.c (rt_hash): Ditto.
* win32_threads.c (GC_get_max_thread_index): Ditto.
* include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
"static"; define for Sun CC; define for VC++ (and other
compilers).
* pthread_support.c: Don't define __inline__ for non-GNU compilers
(not needed anymore).

ChangeLog
allchblk.c
alloc.c
include/private/gc_priv.h
mark_rts.c
pthread_support.c
win32_threads.c

index eaa9d58..655e833 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
 
+       * allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
+       with GC_INLINE.
+       * include/private/gc_priv.h (fixed_getenv): Ditto.
+       * alloc.c (GC_max, GC_min): Replace "static INLINE" with
+       GC_INLINE.
+       * mark_rts.c (rt_hash): Ditto.
+       * win32_threads.c (GC_get_max_thread_index): Ditto.
+       * include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
+       "static"; define for Sun CC; define for VC++ (and other
+       compilers).
+       * pthread_support.c: Don't define __inline__ for non-GNU compilers
+       (not needed anymore).
+
+2009-09-26  Ivan Maidanski <ivmai@mail.ru>
+
        * NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak).
        * Makefile.in: Remove reference to NT_THREADS_MAKEFILE.
        * Makefile.am: Ditto.
index b2a5ea7..0e37306 100644 (file)
@@ -55,10 +55,7 @@ struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 };
   /* Is GC_large_allocd_bytes + the number of free bytes on lists       */
   /* n .. N_HBLK_FLS > GC_max_large_allocd_bytes.                       */
   /* If there is no such n, return 0.                                   */
-# ifdef __GNUC__
-  __inline__
-# endif
-  static int GC_enough_large_bytes_left(void)
+  GC_INLINE int GC_enough_large_bytes_left(void)
   {
     int n;
     word bytes = GC_large_allocd_bytes;
diff --git a/alloc.c b/alloc.c
index d40d8f0..d2a79b5 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -1044,12 +1044,12 @@ void GC_print_heap_sects(void)
 void * GC_least_plausible_heap_addr = (void *)ONES;
 void * GC_greatest_plausible_heap_addr = 0;
 
-static INLINE word GC_max(word x, word y)
+GC_INLINE word GC_max(word x, word y)
 {
     return(x > y? x : y);
 }
 
-static INLINE word GC_min(word x, word y)
+GC_INLINE word GC_min(word x, word y)
 {
     return(x < y? x : y);
 }
index c85e19b..7dde650 100644 (file)
@@ -90,11 +90,14 @@ typedef char * ptr_t;   /* A generic pointer to which we can add        */
 # define EXPECT(expr, outcome) (expr)
 #endif /* __GNUC__ */
 
-#if __GNUC__ >= 3
-# define INLINE inline
+#if defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__DMC__) \
+        || defined(__WATCOMC__)
+# define GC_INLINE static __inline
+#elif (__GNUC__ >= 3) || defined(__sun)
+# define GC_INLINE static inline
 #else
-# define INLINE
-#endif /* __GNUC__ */
+# define GC_INLINE static
+#endif
 
 #ifndef GC_API_PRIV
 # define GC_API_PRIV GC_API
@@ -399,7 +402,7 @@ extern GC_warn_proc GC_current_warn_proc;
 #if !defined(NO_GETENV)
 #   if defined(EMPTY_GETENV_RESULTS)
         /* Workaround for a reputed Wine bug.   */
-        static inline char * fixed_getenv(const char *name)
+        GC_INLINE char * fixed_getenv(const char *name)
         {
           char * tmp = getenv(name);
           if (tmp == 0 || strlen(tmp) == 0)
index 99ee278..d696bb4 100644 (file)
@@ -92,7 +92,7 @@ GC_bool GC_is_static_root(ptr_t p)
         -- really defined in gc_priv.h
 */
 
-static INLINE int rt_hash(ptr_t addr)
+GC_INLINE int rt_hash(ptr_t addr)
 {
     word result = (word) addr;
 #   if CPP_WORDSZ > 8*LOG_RT_SIZE
index f5cdbf1..5443992 100644 (file)
@@ -100,10 +100,6 @@ unsigned long GC_lock_holder = NO_THREAD;
   typedef unsigned int  sem_t;
 #endif /* GC_DGUX386_THREADS */
 
-#ifndef __GNUC__
-#   define __inline__
-#endif
-
 /* Undefine macros used to redirect pthread primitives. */
 # undef pthread_create
 # if !defined(GC_DARWIN_THREADS)
index 701d6b1..939b846 100644 (file)
@@ -494,10 +494,7 @@ static GC_thread GC_register_my_thread_inner(const struct GC_stack_base *sb,
  * GC_max_thread_index may temporarily be larger than MAX_THREADS.
  * To avoid subscript errors, we check on access.
  */
-#ifdef __GNUC__
-  __inline__
-#endif
-STATIC LONG GC_get_max_thread_index(void)
+GC_INLINE LONG GC_get_max_thread_index(void)
 {
   LONG my_max = GC_max_thread_index;