[#4858] Build fails on OSX Tiger 10.4 — noreply@...

Bugs item #1883, was opened at 2005-05-06 14:55

21 messages 2005/05/06
[#4862] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Yukihiro Matsumoto <matz@...> 2005/05/07

Hi,

[#4865] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Ryan Davis <ryand-ruby@...> 2005/05/07

[#4868] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — nobu.nokada@... 2005/05/07

Hi,

[#5053] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Shugo Maeda <shugo@...> 2005/05/19

Hi,

[#5056] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Mark Hubbart <discordantus@...> 2005/05/19

On 5/19/05, Shugo Maeda <shugo@ruby-lang.org> wrote:

[#4874] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...>

Hello all,

31 messages 2005/05/10
[#4879] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Pit Capitain <pit@...> 2005/05/11

Ilias Lazaridis schrieb:

[#4883] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

Pit Capitain wrote:

[#4884] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ryan Davis <ryand-ruby@...> 2005/05/12

[#4888] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

Ryan Davis wrote:

[#4889] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — ES <ruby-ml@...> 2005/05/12

[#4890] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

ES wrote:

[#4891] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Alexander Kellett <ruby-lists@...> 2005/05/12

On May 12, 2005, at 3:13 PM, Ilias Lazaridis wrote:

[#4911] Pointless argc check in Array#select — noreply@...

Patches item #1900, was opened at 2005-05-12 09:33

11 messages 2005/05/12

[#4919] - Hierarchical/Modular Directory Structure — Ilias Lazaridis <ilias@...>

The source-code structure should be simplified, lowering barriers for

20 messages 2005/05/12

Re: [PATCH] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings

From: Erik Huelsmann <ehuels@...>
Date: 2005-05-14 12:58:29 UTC
List: ruby-core #4980
Thanks for the quick response!

> > Index: configure.in
> > ===================================================================
> > RCS file: /src/ruby/configure.in,v
> > retrieving revision 1.275
> > diff -u -r1.275 configure.in
> > --- configure.in      30 Apr 2005 02:59:41 -0000      1.275
> > +++ configure.in      14 May 2005 07:45:02 -0000
> > @@ -226,6 +226,8 @@
> >  AC_CHECK_SIZEOF(double, 8)
> >  AC_CHECK_SIZEOF(time_t, 0)
> >
> > +AC_CHECK_TYPES([pid_t, gid_t, uid_t])
> 
> I think AC_TYPE_UID_T and AC_TYPE_PID_T also would be 
> needed to remove.

Yes. Though I have not been able to find any reference to
AC_TYPE_PID_T, I did remove AC_TYPE_UID_T.

> > Index: process.c
> > ===================================================================
> > RCS file: /src/ruby/process.c,v
> > retrieving revision 1.129
> > diff -u -r1.129 process.c
> > --- process.c 4 Mar 2005 06:47:41 -0000       1.129
> > +++ process.c 14 May 2005 07:45:03 -0000
> > @@ -1847,14 +1847,14 @@
> >      if (pid < 0) rb_sys_fail(0);
> >      return INT2FIX(pid);
> >  #elif defined(HAVE_SETPGRP) && defined(TIOCNOTTY)
> > -  pid_t pid;
> > +  rb_pid_t pid;
> >    int ret;
> >
> >    rb_secure(2);
> >    pid = getpid();
> >  #if defined(SETPGRP_VOID)
> >    ret = setpgrp();
> > -  /* If `pid_t setpgrp(void)' is equivalent to setsid(),
> > +  /* If `rb_pid_t setpgrp(void)' is equivalent to setsid(),
> 
> This is overdone, isn't it?

Yes. removed.
 
> > Index: ruby.h
> > ===================================================================
> > RCS file: /src/ruby/ruby.h,v
> > retrieving revision 1.111
> > diff -u -r1.111 ruby.h
> > --- ruby.h    30 Apr 2005 02:59:41 -0000      1.111
> > +++ ruby.h    14 May 2005 07:45:03 -0000
> > @@ -82,6 +82,25 @@
> >  typedef unsigned long VALUE;
> >  typedef unsigned long ID;
> >
> > +#if ! HAVE_PID_T
> > +  typedef int rb_pid_t;
> > +#else
> > +  typedef pid_t rb_pid_t;
> > +#endif
> 
> Why not #ifdef?
Error on my part. Corrected in the attached patch.


Updated patch attached.

The log:

[[[
Resolve possible type definition conflicts by defining types in
the rb_ namespace instead of defining POSIX type names.

* configure.in: Check for the availability of pid_t, gid_t and uid_t and
  remove AC_TYPE_UID_T.

* defines.h: Remove pid_t typedef.

* ruby.h: Define rb_pid_t, rb_gid_t and rb_uid_t in accordance with
 the available system types.

* process.c: Change instances of pid_t and gid_t to their rb_*
 counterparts.

* ext/pty/pty.c: Change pid_t to rb_pid_t.

* vms/config.h: Define HAVE_{P,G,U}ID_T to 1.

* win32/Makefile.sub: Remove #define for {g,u}id_t.

* win32/win32.c: Change pid_t to rb_pid_t.

* wince/Makefile.sub: Remove #define for {g,u}id_t.

* wince/sys/types.h: Remove definitions of {p,g,u}id_t.

]]]

Attachments (1)

non-conflicting-defines.diff (7.67 KB, text/x-diff)
? non-conflicting-defines.diff
? ext/dl/callback.h
? ext/ripper/mkmf.log
? ext/ripper/ripper.output
? ext/socket/constants.h
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.275
diff -u -r1.275 configure.in
--- configure.in	30 Apr 2005 02:59:41 -0000	1.275
+++ configure.in	14 May 2005 12:57:49 -0000
@@ -226,6 +226,8 @@
 AC_CHECK_SIZEOF(double, 8)
 AC_CHECK_SIZEOF(time_t, 0)
 
+AC_CHECK_TYPES([pid_t, gid_t, uid_t])
+
 AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
   [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
 	rb_cv_have_prototypes=yes,
@@ -454,7 +456,6 @@
 ])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_UID_T
 AC_TYPE_SIZE_T
 AC_STRUCT_ST_BLKSIZE
 AC_STRUCT_ST_BLOCKS
Index: defines.h
===================================================================
RCS file: /src/ruby/defines.h,v
retrieving revision 1.41
diff -u -r1.41 defines.h
--- defines.h	14 Apr 2004 02:03:15 -0000	1.41
+++ defines.h	14 May 2005 12:57:49 -0000
@@ -176,7 +176,6 @@
 #ifndef X_OK
 #define X_OK 1
 #endif
-typedef int pid_t;
 #endif /* __APPLE__ */
 #endif /* NeXT */
 
Index: process.c
===================================================================
RCS file: /src/ruby/process.c,v
retrieving revision 1.129
diff -u -r1.129 process.c
--- process.c	4 Mar 2005 06:47:41 -0000	1.129
+++ process.c	14 May 2005 12:57:50 -0000
@@ -1847,7 +1847,7 @@
     if (pid < 0) rb_sys_fail(0);
     return INT2FIX(pid);
 #elif defined(HAVE_SETPGRP) && defined(TIOCNOTTY)
-  pid_t pid;
+  rb_pid_t pid;
   int ret;
 
   rb_secure(2);
@@ -2642,10 +2642,10 @@
 #ifdef HAVE_GETGROUPS
     VALUE ary;
     size_t ngroups;
-    gid_t *groups;
+    rb_gid_t *groups;
     int i;
 
-    groups = ALLOCA_N(gid_t, maxgroups);
+    groups = ALLOCA_N(rb_gid_t, maxgroups);
 
     ngroups = getgroups(maxgroups, groups);
     if (ngroups == -1)
@@ -2681,7 +2681,7 @@
 {
 #ifdef HAVE_SETGROUPS
     size_t ngroups;
-    gid_t *groups;
+    rb_gid_t *groups;
     int i;
     struct group *gr;
 
@@ -2691,7 +2691,7 @@
     if (ngroups > maxgroups)
 	rb_raise(rb_eArgError, "too many groups, %d max", maxgroups);
 
-    groups = ALLOCA_N(gid_t, ngroups);
+    groups = ALLOCA_N(rb_gid_t, ngroups);
 
     for (i = 0; i < ngroups && i < RARRAY(ary)->len; i++) {
 	VALUE g = RARRAY(ary)->ptr[i];
@@ -2749,7 +2749,7 @@
     VALUE obj, uname, base_grp;
 {
 #ifdef HAVE_INITGROUPS
-    if (initgroups(StringValuePtr(uname), (gid_t)NUM2INT(base_grp)) != 0) {
+    if (initgroups(StringValuePtr(uname), (rb_gid_t)NUM2INT(base_grp)) != 0) {
 	rb_sys_fail(0);
     }
     return proc_getgroups(obj);
Index: ruby.h
===================================================================
RCS file: /src/ruby/ruby.h,v
retrieving revision 1.111
diff -u -r1.111 ruby.h
--- ruby.h	30 Apr 2005 02:59:41 -0000	1.111
+++ ruby.h	14 May 2005 12:57:50 -0000
@@ -82,6 +82,25 @@
 typedef unsigned long VALUE;
 typedef unsigned long ID;
 
+#ifdef HAVE_PID_T
+  typedef int rb_pid_t;
+#else
+  typedef pid_t rb_pid_t;
+#endif
+
+#ifdef HAVE_GID_T
+  typedef int rb_gid_t;
+#else
+  typedef gid_t rb_gid_t;
+#endif
+
+#ifdef HAVE_UID_T
+  typedef int rb_uid_t;
+#else
+  typedef uid_t rb_uid_t;
+#endif
+
+
 #ifdef __STDC__
 # include <limits.h>
 #else
Index: ext/pty/pty.c
===================================================================
RCS file: /src/ruby/ext/pty/pty.c,v
retrieving revision 1.22
diff -u -r1.22 pty.c
--- ext/pty/pty.c	4 Mar 2005 06:47:38 -0000	1.22
+++ ext/pty/pty.c	14 May 2005 12:57:50 -0000
@@ -128,7 +128,7 @@
 
 struct pty_info {
     int fd;
-    pid_t child_pid;
+    rb_pid_t child_pid;
     VALUE thread;
 };
 
Index: vms/config.h
===================================================================
RCS file: /src/ruby/vms/config.h,v
retrieving revision 1.1
diff -u -r1.1 config.h
--- vms/config.h	26 Dec 2003 01:39:25 -0000	1.1
+++ vms/config.h	14 May 2005 12:57:51 -0000
@@ -23,6 +23,9 @@
 #define HAVE_GETPGRP 1
 /* #define HAVE_GETPRIORITY 1 */
 /* #define HAVE_GETRLIMIT 1 */
+#define HAVE_PID_T 1
+#define HAVE_GID_T 1
+#define HAVE_UID_T 1
 #define HAVE_HYPOT 1
 #define HAVE_ISASCII 1
 /* #define HAVE_ISINF 1 */
Index: win32/Makefile.sub
===================================================================
RCS file: /src/ruby/win32/Makefile.sub,v
retrieving revision 1.94
diff -u -r1.94 Makefile.sub
--- win32/Makefile.sub	13 May 2005 14:44:43 -0000	1.94
+++ win32/Makefile.sub	14 May 2005 12:57:51 -0000
@@ -229,8 +229,6 @@
 #define HAVE_FCNTL_H 1
 #define HAVE_SYS_UTIME_H 1
 #define HAVE_FLOAT_H 1
-#define uid_t int
-#define gid_t int
 #define HAVE_STRUCT_STAT_ST_RDEV 1
 #define HAVE_ST_RDEV 1
 #define GETGROUPS_T int
Index: win32/win32.c
===================================================================
RCS file: /src/ruby/win32/win32.c,v
retrieving revision 1.147
diff -u -r1.147 win32.c
--- win32/win32.c	5 Mar 2005 09:30:24 -0000	1.147
+++ win32/win32.c	14 May 2005 12:57:52 -0000
@@ -445,7 +445,7 @@
 
 static struct ChildRecord {
     HANDLE hProcess;	/* process handle */
-    pid_t pid;		/* process id */
+    rb_pid_t pid;	/* process id */
 } ChildRecord[MAXCHILDNUM];
 
 #define FOREACH_CHILD(v) do { \
@@ -463,7 +463,7 @@
 }
 
 static struct ChildRecord *
-FindChildSlot(pid_t pid)
+FindChildSlot(rb_pid_t pid)
 {
 
     FOREACH_CHILD(child) {
@@ -678,7 +678,7 @@
 
 static int socketpair_internal(int af, int type, int protocol, SOCKET *sv);
 
-pid_t
+rb_pid_t
 rb_w32_pipe_exec(const char *cmd, const char *prog, int mode, int *pipe)
 {
     struct ChildRecord* child;
@@ -987,7 +987,7 @@
     CloseHandle(aProcessInformation.hThread);
 
     child->hProcess = aProcessInformation.hProcess;
-    child->pid = (pid_t)aProcessInformation.dwProcessId;
+    child->pid = (rb_pid_t)aProcessInformation.dwProcessId;
 
     if (!IsWinNT()) {
 	/* On Win9x, make pid positive similarly to cygwin and perl */
@@ -2577,7 +2577,7 @@
 #define WNOHANG -1
 #endif
 
-static pid_t
+static rb_pid_t
 poll_child_status(struct ChildRecord *child, int *stat_loc)
 {
     DWORD exitcode;
@@ -2595,7 +2595,7 @@
     }
     if (exitcode != STILL_ACTIVE) {
 	/* If already died, return immediatly. */
-	pid_t pid = child->pid;
+	rb_pid_t pid = child->pid;
 	CloseChildHandle(child);
 	if (stat_loc) *stat_loc = exitcode << 8;
 	return pid;
@@ -2603,8 +2603,8 @@
     return 0;
 }
 
-pid_t
-waitpid (pid_t pid, int *stat_loc, int options)
+rb_pid_t
+waitpid (rb_pid_t pid, int *stat_loc, int options)
 {
     DWORD timeout;
 
@@ -3435,10 +3435,10 @@
 }
 
 #undef getpid
-pid_t
+rb_pid_t
 rb_w32_getpid(void)
 {
-    pid_t pid;
+    rb_pid_t pid;
 
     pid = getpid();
 
Index: wince/Makefile.sub
===================================================================
RCS file: /src/ruby/wince/Makefile.sub,v
retrieving revision 1.38
diff -u -r1.38 Makefile.sub
--- wince/Makefile.sub	13 May 2005 14:44:43 -0000	1.38
+++ wince/Makefile.sub	14 May 2005 12:57:52 -0000
@@ -231,8 +231,6 @@
 #define HAVE_FCNTL_H 1
 #define HAVE_SYS_UTIME_H 1
 #define HAVE_FLOAT_H 1
-#define uid_t int
-#define gid_t int
 #define HAVE_STRUCT_STAT_ST_RDEV 1
 #define HAVE_ST_RDEV 1
 #define GETGROUPS_T int
Index: wince/sys/types.h
===================================================================
RCS file: /src/ruby/wince/sys/types.h,v
retrieving revision 1.1
diff -u -r1.1 types.h
--- wince/sys/types.h	14 Dec 2002 05:27:35 -0000	1.1
+++ wince/sys/types.h	14 May 2005 12:57:52 -0000
@@ -19,8 +19,6 @@
   #define _MODE_T_DEFINED_
 #endif
 
-//typedef unsigned short gid_t;
-//typedef unsigned short uid_t;
 typedef long clock_t;
 
 #ifndef _PTRDIFF_T_DEFINED
@@ -58,10 +56,5 @@
 //typedef unsigned long time_t;
 //#define _TIME_T_DEFINED_
 //#endif
-
-#ifndef _PID_T_DEFINED_
-typedef unsigned long pid_t;
-#define _PID_T_DEFINED_
-#endif
 
 #endif

In This Thread