Hi all,

I ran into an interesting issue today. Hoping some of you have some
insight for me. I needed to use a later addition to the pthreads spec -
pthread_mutexaddr_settype (in order to initialize a recursive mutex). To
use this function, you need to define __USE_UNIX98 before including
pthread.h - at least on my platform (opensuse 11.3 64-bit).

I was trying to figure out how to get Autoconf-generated configure
scripts to define this macro for me if it was needed. The truth,
however, is that if I need UNIX98 functionality, and it's not available
on a platform, configure needs to fail (at least in my case).

Because the library actually provides the function, but it's not
"enabled" in pthread.h, AC_CHECK_FUNCS is succeeding without issue
(which I would expect, because of the way it's designed to look for
library exports, and not header file entries), but the compiler is
complaining that the function is being used without a prototype (which
is completely true if __USE_UNIX98 is not defined).

What is the correct approach for this situation? Should I simply define
__USE_UNIX98 in my source code because I need the associated
functionality? Is __USE_UNIX98 a widely used and understood macro?
(Google searches didn't really help me understand the proper use of this
macro.)

TIA,
John

_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to