headers: properly decorate attributes
As pointed out here: https://cygwin.com/ml/cygwin/2014-07/msg00371.html any use of __attribute__ in a header that can be included by a user should be namespace-safe, by decorating the attribute arguments with __ (while gcc does a lousy job at documenting it, ALL attributes have a __ counterpart, precisely so that public headers can use attributes without risk of collision with macros belonging to user namespace). * include/pthread.h: Decorate attribute names with __, for namespace safety. * include/cygwin/core_dump.h: Likewise. * include/cygwin/cygwin_dll.h: Likewise. * include/sys/cygwin.h: Likewise. * include/sys/strace.h: Likewise.
This commit is contained in:
		| @@ -1,3 +1,12 @@ | ||||
| 2014-07-31  Eric Blake  <eblake@redhat.com> | ||||
|  | ||||
| 	* include/pthread.h: Decorate attribute names with __, for | ||||
| 	namespace safety. | ||||
| 	* include/cygwin/core_dump.h: Likewise. | ||||
| 	* include/cygwin/cygwin_dll.h: Likewise. | ||||
| 	* include/sys/cygwin.h: Likewise. | ||||
| 	* include/sys/strace.h: Likewise. | ||||
|  | ||||
| 2014-07-30  Corinna Vinschen  <corinna@vinschen.de> | ||||
|  | ||||
| 	* uinfo.cc (pwdgrp::fetch_account_from_windows): Fix comment. | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* core_dump.h | ||||
|  | ||||
|    Copyright 1999, 2000, 2001 Red Hat, Inc. | ||||
|    Copyright 1999, 2000, 2001, 2014 Red Hat, Inc. | ||||
|  | ||||
|    Written by Egor Duda <deo@logos-m.ru> | ||||
|  | ||||
| @@ -27,7 +27,7 @@ struct win32_core_process_info | ||||
|   char command_line[1]; | ||||
| } | ||||
| #ifdef __GNUC__ | ||||
|   __attribute__ ((packed)) | ||||
|   __attribute__ ((__packed__)) | ||||
| #endif | ||||
| ; | ||||
|  | ||||
| @@ -38,7 +38,7 @@ struct win32_core_thread_info | ||||
|   CONTEXT thread_context; | ||||
| } | ||||
| #ifdef __GNUC__ | ||||
|   __attribute__ ((packed)) | ||||
|   __attribute__ ((__packed__)) | ||||
| #endif | ||||
| ; | ||||
|  | ||||
| @@ -49,7 +49,7 @@ struct win32_core_module_info | ||||
|   char module_name[1]; | ||||
| } | ||||
| #ifdef __GNUC__ | ||||
|   __attribute__ ((packed)) | ||||
|   __attribute__ ((__packed__)) | ||||
| #endif | ||||
| ; | ||||
|  | ||||
| @@ -64,7 +64,7 @@ struct win32_pstatus | ||||
|     } data ; | ||||
| } | ||||
| #ifdef __GNUC__ | ||||
|   __attribute__ ((packed)) | ||||
|   __attribute__ ((__packed__)) | ||||
| #endif | ||||
| ; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* cygwin_dll.h | ||||
|  | ||||
|    Copyright 1998, 1999, 2000, 2001, 2009, 2011, 2012, 2013 Red Hat, Inc. | ||||
|    Copyright 1998, 1999, 2000, 2001, 2009, 2011, 2012, 2013, 2014 Red Hat, Inc. | ||||
|  | ||||
| This file is part of Cygwin. | ||||
|  | ||||
| @@ -35,9 +35,9 @@ static DWORD storedReason;						      \ | ||||
| static void* storedPtr;							      \ | ||||
| int __dynamically_loaded;						      \ | ||||
| 									      \ | ||||
| static int __dllMain (int a __attribute__ ((unused)),			      \ | ||||
| 		      char **b __attribute__ ((unused)),		      \ | ||||
| 		      char **c __attribute__ ((unused)))		      \ | ||||
| static int __dllMain (int a __attribute__ ((__unused__)),		      \ | ||||
| 		      char **b __attribute__ ((__unused__)),		      \ | ||||
| 		      char **c __attribute__ ((__unused__)))		      \ | ||||
| {									      \ | ||||
|   return Entry (storedHandle, storedReason, storedPtr);		              \ | ||||
| }									      \ | ||||
|   | ||||
| @@ -76,7 +76,7 @@ int pthread_attr_getschedpolicy (const pthread_attr_t *, int *); | ||||
| int pthread_attr_getscope (const pthread_attr_t *, int *); | ||||
| int pthread_attr_getstack (const pthread_attr_t *, void **, size_t *); | ||||
| int pthread_attr_getstackaddr (const pthread_attr_t *, void **) | ||||
|     __attribute__ ((deprecated)); | ||||
|     __attribute__ ((__deprecated__)); | ||||
| int pthread_attr_init (pthread_attr_t *); | ||||
| int pthread_attr_setdetachstate (pthread_attr_t *, int); | ||||
| int pthread_attr_setguardsize (pthread_attr_t *, size_t); | ||||
| @@ -88,7 +88,7 @@ int pthread_attr_setscope (pthread_attr_t *, int); | ||||
| #ifdef _POSIX_THREAD_ATTR_STACKADDR | ||||
| int pthread_attr_setstack (pthread_attr_t *, void *, size_t); | ||||
| int pthread_attr_setstackaddr (pthread_attr_t *, void *) | ||||
|     __attribute__ ((deprecated)); | ||||
|     __attribute__ ((__deprecated__)); | ||||
| #endif | ||||
|  | ||||
| #ifdef _POSIX_THREAD_ATTR_STACKSIZE | ||||
| @@ -137,7 +137,7 @@ int pthread_create (pthread_t *, const pthread_attr_t *, | ||||
| 		    void *(*)(void *), void *); | ||||
| int pthread_detach (pthread_t); | ||||
| int pthread_equal (pthread_t, pthread_t); | ||||
| void pthread_exit (void *) __attribute__ ((noreturn)); | ||||
| void pthread_exit (void *) __attribute__ ((__noreturn__)); | ||||
| int pthread_getcpuclockid (pthread_t, clockid_t *); | ||||
| int pthread_getschedparam (pthread_t, int *, struct sched_param *); | ||||
| void *pthread_getspecific (pthread_key_t); | ||||
|   | ||||
| @@ -26,21 +26,21 @@ extern "C" { | ||||
| /* DEPRECATED INTERFACES.  These are restricted to MAX_PATH length. | ||||
|    Don't use in modern applications.  They don't exist on x86_64. */ | ||||
| extern int cygwin_win32_to_posix_path_list (const char *, char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_win32_to_posix_path_list_buf_size (const char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_posix_to_win32_path_list (const char *, char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_posix_to_win32_path_list_buf_size (const char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_conv_to_win32_path (const char *, char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_conv_to_full_win32_path (const char *, char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_conv_to_posix_path (const char *, char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| extern int cygwin_conv_to_full_posix_path (const char *, char *) | ||||
|   __attribute__ ((deprecated)); | ||||
|   __attribute__ ((__deprecated__)); | ||||
| #endif /* !__x86_64__ */ | ||||
|  | ||||
| /* Use these interfaces in favor of the above. */ | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| /* sys/strace.h | ||||
|  | ||||
|    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, | ||||
|    2010, 2011, 2012 Red Hat, Inc. | ||||
|    2010, 2011, 2012, 2014 Red Hat, Inc. | ||||
|  | ||||
| This file is part of Cygwin. | ||||
|  | ||||
| @@ -40,17 +40,17 @@ class strace | ||||
|   void write (unsigned category, const char *buf, int count); | ||||
|   unsigned char _active; | ||||
| public: | ||||
|   void activate (bool) __attribute__ ((regparm (2)));; | ||||
|   void activate (bool) __attribute__ ((__regparm__ (2)));; | ||||
|   strace () {} | ||||
|   int microseconds (); | ||||
|   int version; | ||||
|   int lmicrosec; | ||||
|   bool execing; | ||||
|   void dll_info () __attribute__ ((regparm (1))); | ||||
|   void prntf (unsigned, const char *func, const char *, ...) /*__attribute__ ((regparm(3)))*/; | ||||
|   void vprntf (unsigned, const char *func, const char *, va_list ap) /*__attribute__ ((regparm(3)))*/; | ||||
|   void wm (int message, int word, int lon) __attribute__ ((regparm(3))); | ||||
|   void write_childpid (pid_t) __attribute__ ((regparm (3))); | ||||
|   void dll_info () __attribute__ ((__regparm__ (1))); | ||||
|   void prntf (unsigned, const char *func, const char *, ...) /*__attribute__ ((__regparm__(3)))*/; | ||||
|   void vprntf (unsigned, const char *func, const char *, va_list ap) /*__attribute__ ((__regparm__(3)))*/; | ||||
|   void wm (int message, int word, int lon) __attribute__ ((__regparm__(3))); | ||||
|   void write_childpid (pid_t) __attribute__ ((__regparm__ (3))); | ||||
|   bool attached () const {return _active == 3;} | ||||
|   bool active () const {return _active & 1;} | ||||
|   unsigned char& active_val () {return _active;} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user