public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc4.5.0/libiberty/pex-common.h missing pid_t on vms
@ 2010-05-03 11:05 Jay K
  2010-05-03 20:02 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Jay K @ 2010-05-03 11:05 UTC (permalink / raw)
  To: gcc


In file included from /src/gcc-4.5.0/libiberty/pex-common.c:23:0:
/src/gcc-4.5.0/libiberty/pex-common.h:73:3: error: expected specifier-qualifier-list before 'pid_t'


the code:

/* pid_t is may defined by config.h or sys/types.h needs to be
   included.  */
#if !defined(pid_t) && defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif


proposed/tested fix:
#ifdef __vms
#include <unistd.h>
#endif

or similar.

This then hits:

/usr/local/lib/gcc/alpha-dec-vms/4_5_0/../../../../alpha-dec-vms/include/unistd.h:475:22: error: macro "geteuid" passed 1 arguments, but takes just 0
/usr/local/lib/gcc/alpha-dec-vms/4_5_0/../../../../alpha-dec-vms/include/unistd.h:476:22: error: macro "getuid" passed 1 arguments, but takes just 0
make[2]: *** [pex-common.o] Error 1


But I say that's a bug in the VMS headers and I patch it:

#if __USE_LONG_GID_T
#   pragma __extern_prefix __save
#   pragma __extern_prefix "__long_gid_"
#elif __CRTL_VER>= 70000000 && !defined(_VMS_V6_SOURCE)
#   if __CAN_USE_EXTERN_PREFIX
#      pragma __extern_prefix __save
#      pragma __extern_prefix "__unix_"
#   else
-#    define geteuid() __unix_geteuid()
-#    define getuid() __unix_getuid()
+#    define geteuid __unix_geteuid
+#    define getuid __unix_getuid
#   endif
#endif


__uid_t geteuid (void);
__uid_t getuid  (void);


I did the same thing in the VMS header unixlib.h.
Maybe something for fixincludes? (along with #define __NEW_STARLET, #define __int64 long long...)


(Alternate interpretation is that gcc should implement __CAN_USE_EXTERN_PREFIX
and the #pragmas. I'd be willing to #define __USE_LONG_GID_T but I assume the pragmas are a problem.)


 - Jay 		 	   		  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc4.5.0/libiberty/pex-common.h missing pid_t on vms
  2010-05-03 11:05 gcc4.5.0/libiberty/pex-common.h missing pid_t on vms Jay K
@ 2010-05-03 20:02 ` Ian Lance Taylor
  2010-05-05 10:12   ` Jay K
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2010-05-03 20:02 UTC (permalink / raw)
  To: Jay K; +Cc: gcc

Jay K <jay.krell@cornell.edu> writes:

> proposed/tested fix:
> #ifdef __vms
> #include <unistd.h>
> #endif
>
> or similar.

Use #ifdef HAVE_UNISTD_H instead.  There are many examples in
libiberty.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: gcc4.5.0/libiberty/pex-common.h missing pid_t on vms
  2010-05-03 20:02 ` Ian Lance Taylor
@ 2010-05-05 10:12   ` Jay K
  0 siblings, 0 replies; 3+ messages in thread
From: Jay K @ 2010-05-05 10:12 UTC (permalink / raw)
  To: iant; +Cc: gcc


> Use #ifdef HAVE_UNISTD_H instead. There are many examples in
> libiberty.
>
> Ian


Thanks Ian, that worked.


--- /src/orig/gcc-4.5.0/libiberty/pex-common.h    2009-04-13 03:45:58.000000000 -0700
+++ /src/gcc-4.5.0/libiberty/pex-common.h    2010-05-04 06:43:24.000000000 -0700
@@ -31,6 +31,9 @@
 #if !defined(pid_t) && defined(HAVE_SYS_TYPES_H)
 #include <sys/types.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #define install_error_msg "installation problem, cannot exec `%s'"


Perhaps someone can apply it..
Sorry, not me.


 - Jay
 		 	   		  

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-05 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-03 11:05 gcc4.5.0/libiberty/pex-common.h missing pid_t on vms Jay K
2010-05-03 20:02 ` Ian Lance Taylor
2010-05-05 10:12   ` Jay K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).