# HG changeset patch # User Bruno Haible # Date 1213747586 -7200 # Node ID 5af483b0ae69e341ea650af3736ab92f7c04ee5a # Parent 2bab2200e00204f31ec7a6c0f2463825e9bb77f7 Avoid unused value warnings. diff -r 2bab2200e002 -r 5af483b0ae69 ChangeLog --- 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 + + * lib/tls.h (gl_tls_key_init): Evaluate the destructor argument also + when the macro ignores it. + Based on a patch by Eric Blake . + 2008-06-17 Bruno Haible * modules/tls (License): Change to LGPLv2+. diff -r 2bab2200e002 -r 5af483b0ae69 lib/tls.h --- 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) \