changeset 10216:5af483b0ae69

Avoid unused value warnings.
author Bruno Haible <bruno@clisp.org>
date Wed, 18 Jun 2008 02:06:26 +0200
parents 2bab2200e002
children e2d27ec15b00
files ChangeLog lib/tls.h
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jun 18 01:52:21 2008 +0200
+++ b/ChangeLog	Wed Jun 18 02:06:26 2008 +0200
@@ -1,3 +1,9 @@
+2008-06-17  Bruno Haible  <bruno@clisp.org>
+
+	* lib/tls.h (gl_tls_key_init): Evaluate the destructor argument also
+	when the macro ignores it.
+	Based on a patch by Eric Blake <ebb9@byu.net>.
+
 2008-06-17  Bruno Haible  <bruno@clisp.org>
 
 	* modules/tls (License): Change to LGPLv2+.
--- a/lib/tls.h	Wed Jun 18 01:52:21 2008 +0200
+++ b/lib/tls.h	Wed Jun 18 02:06:26 2008 +0200
@@ -1,5 +1,5 @@
 /* Thread-local storage in multithreaded situations.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   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,6 +285,7 @@
       {                                          \
         if (((NAME) = TlsAlloc ()) == (DWORD)-1) \
           abort ();                              \
+        (void) (DESTRUCTOR);                     \
       }                                          \
     while (0)
 # define gl_tls_get(NAME) \
@@ -320,7 +321,8 @@
         }
         gl_tls_key_t;
 # define gl_tls_key_init(NAME, DESTRUCTOR) \
-    (NAME).singlethread_value = NULL
+    ((NAME).singlethread_value = NULL, \
+     (void) (DESTRUCTOR))
 # define gl_tls_get(NAME) \
     (NAME).singlethread_value
 # define gl_tls_set(NAME, POINTER) \