This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to __gthread_active_ptr


While looking at another bug, I noticed that __gthread_active_ptr was
showing up in a source file that just used some libstdc++ headers.  Fixed
thus.

Tested i686-pc-linux-gnu, applied trunk and branch.

2002-03-13  Jason Merrill  <jason@redhat.com>

	* gthr-posix.h (__gthread_active_p): Move __gthread_active_ptr
	into the function and constify it.
	* gthr-dce.h, gthr-solaris.h: Likewise.

*** gthr-posix.h.~1~	Fri Nov  2 17:20:03 2001
--- gthr-posix.h	Tue Mar 12 15:34:29 2002
*************** typedef pthread_mutex_t __gthread_mutex_
*** 77,87 ****
  #pragma weak pthread_setschedparam
  #endif
  
- static void *__gthread_active_ptr = (void *) &pthread_create;
- 
  static inline int
  __gthread_active_p (void)
  {
    return __gthread_active_ptr != 0;
  }
  
--- 77,86 ----
  #pragma weak pthread_setschedparam
  #endif
  
  static inline int
  __gthread_active_p (void)
  {
+   static void *const __gthread_active_ptr = (void *) &pthread_create;
    return __gthread_active_ptr != 0;
  }
  
*** gthr-dce.h.~1~	Mon Dec  3 02:44:04 2001
--- gthr-dce.h	Tue Mar 12 15:35:08 2002
*************** typedef pthread_mutex_t __gthread_mutex_
*** 87,97 ****
  #pragma weak pthread_yield
  #endif
  
- static void *__gthread_active_ptr = (void *) &pthread_create;
- 
  static inline int
  __gthread_active_p (void)
  {
    return __gthread_active_ptr != 0;
  }
  
--- 87,96 ----
  #pragma weak pthread_yield
  #endif
  
  static inline int
  __gthread_active_p (void)
  {
+   static void *const __gthread_active_ptr = (void *) &pthread_create;
    return __gthread_active_ptr != 0;
  }
  
*** gthr-solaris.h.~1~	Fri Nov  2 17:20:03 2001
--- gthr-solaris.h	Tue Mar 12 15:34:24 2002
*************** typedef mutex_t __gthread_mutex_t;
*** 81,91 ****
  /* This will not actually work in Solaris 2.5, since libc contains
     dummy symbols of all thr_* routines.  */
  
- static void *__gthread_active_ptr = (void *) &thr_create;
- 
  static inline int
  __gthread_active_p (void)
  {
    return __gthread_active_ptr != 0;
  }
  
--- 81,90 ----
  /* This will not actually work in Solaris 2.5, since libc contains
     dummy symbols of all thr_* routines.  */
  
  static inline int
  __gthread_active_p (void)
  {
+   static void *const __gthread_active_ptr = (void *) &thr_create;
    return __gthread_active_ptr != 0;
  }
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]