Hi Eric,
> Even though the destructor is unused in mingw and single-threaded cases, can
> we
> at least evaluate it to avoid this warning?
>
> ../../gllib/strsignal.c:165: warning: 'free_key_mem' defined but not used
Makes sense. I've applied this.
2008-06-17 Bruno Haible <[EMAIL PROTECTED]>
* lib/tls.h (gl_tls_key_init): Evaluate the destructor argument also
when the macro ignores it.
Based on a patch by Eric Blake <[EMAIL PROTECTED]>.
*** lib/tls.h.orig 2008-06-18 02:01:06.000000000 +0200
--- lib/tls.h 2008-06-18 02:00:35.000000000 +0200
***************
*** 1,5 ****
/* Thread-local storage in multithreaded situations.
! Copyright (C) 2005, 2007 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
--- 1,5 ----
/* Thread-local storage in multithreaded situations.
! Copyright (C) 2005, 2007-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
***************
*** 285,290 ****
--- 285,291 ----
{ \
if (((NAME) = TlsAlloc ()) == (DWORD)-1) \
abort (); \
+ (void) (DESTRUCTOR); \
} \
while (0)
# define gl_tls_get(NAME) \
***************
*** 320,326 ****
}
gl_tls_key_t;
# define gl_tls_key_init(NAME, DESTRUCTOR) \
! (NAME).singlethread_value = NULL
# define gl_tls_get(NAME) \
(NAME).singlethread_value
# define gl_tls_set(NAME, POINTER) \
--- 321,328 ----
}
gl_tls_key_t;
# define gl_tls_key_init(NAME, DESTRUCTOR) \
! ((NAME).singlethread_value = NULL, \
! (void) (DESTRUCTOR))
# define gl_tls_get(NAME) \
(NAME).singlethread_value
# define gl_tls_set(NAME, POINTER) \