I first noticed this in Ruben's 4.6.2 build, but the trunk has a 
similar problem (if the winpthead library is installed).

time.h ends

#ifdef __cplusplus
}
#endif

#pragma pack(pop)

#include <sec_api/time_s.h>

/* Adding timespec definition.  */
#include <sys/timeb.h>
#include <pthread_time.h>

The problem is that as a result time.h includes pthread.h which 
includes signal.h and other headers.

My immediate problem was that I was including time.h in an alternative 
signal handler and so had a ton of conflicts.   And this namespace 
pollution is a really bad idea in general.

POSIX 2008 says clock_gettime and timespec are in time.h, but other 
systems (Linux, Solaris) tend to declare such recent-ish additions 
only if some guard is raised, e.g. if _POSIX_C_SOURCE is set to a high 
enough value.  So if it not possible to remove the dependence on 
pthread.h, can it at least be included conditionally?

A less important issue is that pthread_time.h is not included inside 
extern "C" {} and AFAICS does not protect e.g. clock_gettime from 
C++ name-mangling.

Brian Ripley

-- 
Brian D. Ripley,                  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to