[#4834] Fwd: Re: Whats so different about a Hash? — Andrew Walrond <andrew@...>
>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:
On Thursday 05 May 2005 13:48, ts wrote:
>>>>> "A" == Andrew Walrond <andrew@walrond.org> writes:
On Thursday 05 May 2005 13:57, ts wrote:
[#4844] Getting rid of Object#equal?()? — =?ISO-8859-15?Q?Florian_Gro=DF?= <florgro@...>
Moin.
[#4848] No way to change socket timeout on opened URI — noreply@...
Bugs item #1878, was opened at 2005-05-05 17:55
[#4855] Method hooks in singleton classes — Pit Capitain <pit@...>
Hello Ruby-maintainers,
[#4858] Build fails on OSX Tiger 10.4 — noreply@...
Bugs item #1883, was opened at 2005-05-06 14:55
Hi,
Hi,
Hi,
On 5/19/05, Shugo Maeda <shugo@ruby-lang.org> wrote:
Hi,
Hi,
[#4869] Infinite loop on YAML.dump (Re: ruby-list:40801) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Hello.
[#4874] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...>
Hello all,
Ilias Lazaridis schrieb:
Pit Capitain wrote:
Ryan Davis wrote:
ES wrote:
On May 12, 2005, at 3:13 PM, Ilias Lazaridis wrote:
Mathieu Bouchard wrote:
On Thursday 12 May 2005 22:09, Ilias Lazaridis wrote:
Francois GORET wrote:
Hi,
nobu.nokada@softhome.net wrote:
Hi,
nobu.nokada@softhome.net wrote:
[#4881] Encoding Pragma — Bertram Scharpf <lists@...>
Hi,
[#4886] ruby 1.8.3 preview1 — Yukihiro Matsumoto <matz@...>
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> [2005-05-12 17:49]:
>What about [ruby-core:4296]?
[#4911] Pointless argc check in Array#select — noreply@...
Patches item #1900, was opened at 2005-05-12 09:33
noreply@rubyforge.org wrote:
>>>>> "D" == Daniel Berger <djberge@qwest.com> writes:
ts wrote:
>>>>> "D" == Daniel Berger <djberge@qwest.com> writes:
On 5/12/05, ts <decoux@moulon.inra.fr> wrote:
Austin Ziegler wrote:
[#4919] - Hierarchical/Modular Directory Structure — Ilias Lazaridis <ilias@...>
The source-code structure should be simplified, lowering barriers for
Hi,
Nakada, Nobuyoshi wrote:
Ilias Lazaridis wrote:
On 5/14/05, Ilias Lazaridis <ilias@lazaridis.com> wrote:
Austin Ziegler wrote:
Hi,
nobu.nokada@softhome.net wrote:
[#4932] ruby-1.8.3 preview1 - failure: cygwin. — Hugh Sasse <hgs@...>
I've just tried to build the preview and got:
[#4992] Pathname#unlink fails on a symlink which points to a directory. — noreply@...
Bugs item #1917, was opened at 2005-05-14 21:33
In article <200505142133.j4ELXEaM011256@rubyforge.org>,
Hello.
In article <20050515153530.0D9F30E0.ocean@m2.ccsnet.ne.jp>,
[#5006] Suggestion for avoiding incivilities — Gavin Sinclair <gsinclair@...>
Hi all,
[#5010] - Function Argument Conventions — Ilias Lazaridis <ilias@...>
As a general rule, the first argument to a function should be the
[#5020] Problems with the "outer scope" operator — Lothar Scholz <mailinglists@...>
Hello,
[#5039] CGI::escapeHTML escapes the ampersand in an existing escape command — noreply@...
Bugs item #1930, was opened at 2005-05-19 11:45
Hi,
Thu, 19 May 2005 13:09:45 +0900, nobuyoshi nakada
Hi,
[#5040] Suggestion to add alias for underscore style method names to camel case named class methods in CGI — noreply@...
Bugs item #1931, was opened at 2005-05-19 11:46
On Thu, 19 May 2005 noreply@rubyforge.org wrote:
On Thu, 19 May 2005 21:22:46 +0900, David A. Black <dblack@wobblini.net>
[#5068] Re: [ ruby-Patches-1939 ] Pathname, totally revamped — Daniel Berger <djberg96@...>
--- nobu.nokada@softhome.net wrote:
Hi,
On 5/22/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net>
Hi,
[#5070] Re: [ ruby-Patches-1939 ] Pathname, totally revamped — Daniel Berger <djberg96@...>
--- daz <dooby@d10.karoo.co.uk> wrote:
[#5075] Re: [ ruby-Patches-1939 ] Pathname, totally revamped — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
Quoting Daniel.Berger@qwest.com, on Mon, May 23, 2005 at 11:06:58PM +0900:
[#5107] Re: will callable objects be more general in Ruby 1.9? — Eric Mahurin <eric_mahurin@...>
[PATCH] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings
As promised, I attached a patch to eliminate the compile problems
where APR and ruby headers need to combined. In my case, the usecase
is that I want to compile a ruby extention for APR based software.
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.
* 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: Define HAVE_{P,G,U}ID_T to 0.
* win32/win32.c: Change pid_t to rb_pid_t.
* wince/Makefile.sub: Define HAVE_{P,G,U}ID_T to 0.
* wince/sys/types.h: Remove definitions of {p,g,u}id_t.
]]]
Note that I submitted a patch to APR too which should resolve future
problems with other software. I'd appreciate it if you would accept (a
variant of) this patch into the ruby tree.
bye,
Erik.
On 4/26/05, Erik Huelsmann <ehuels@gmail.com> wrote:
> On 4/26/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:
> > Hi,
> >
> > At Tue, 26 Apr 2005 05:05:02 +0900,
> > Erik Huelsmann wrote in [ruby-core:04794]:
> > > > > platforms, it uses what's there. Just like Ruby. I don't think it's a
> > > > > solution for ruby to require that APR uses #undef before the typedef:
> > > > > that would require a change to *all* software with which Ruby is meant
> > > > > to be compiled on windows. Not a pretty solution.
> > > >
> > > > And APR requires a change to all autoconfiscated softwares.
> > >
> > > Actually, Ruby uses a #define (as a result from the old use of
> > > AC_CHECK_TYPE, probably), but the autoconf manual itself says that
> > > AC_CHECK_TYPE with 2 arguments is flawed because it uses #define
> > > instead of typedef.
> >
> > What `flaw'? Using #define instead of typedef itself? I don't
> > consider it a flaw. typedef has its own problem, too. What's
> > the reason why you claim that #define is wrong?
>
> *I* don't call it a flaw, the Autoconf manual does. It has called it a
> flaw ever since Autoconf 2.13 (see the section on AC_CHECK_TYPE and
> its 2 variants).
>
> I don't think using '#define' more wrong than it is to use 'typedef':
> In both cases you're creating a type which is also defined in a
> published standard. That's wrong, since there's no guarantee that your
> software won't be combined (using SWIG for example) with software
> which is going to try to do the same. That's bound to lead to the
> conflict we're seeing.
>
> > > > > I think neither APR nor Ruby should be 'messing' with types defined by
> > > > > POSIX. I'm preparing a patch for APR to stop doing this.
> > > >
> > > > Agreed. typedef which can'te be redefined nor detected at
> > > > compile time shouldn't, at least.
> > >
> > > Right, but since the Subversion Ruby bindings have to include both
> > > ruby.h and apr.h (which should both use typedef for pid_t, if they
> > > were to define it with the 'new' autoconf). So you see the conflict
> > > growing fast: apr can't itself rely on ruby.h being included, nor can
> > > ruby.h rely on apr.h being included, yet both systems try to define
> > > pid_t.
> >
> > So macro would be better than typedef in that sense. Anyhow,
> > the macro is mandatory to compile them together.
> >
> > Maybe best ways were that all programs using pid_t have:
> >
> > #ifndef pid_t
> > typedef int pid_t;
> > #define pid_t pid_t
> > #endif
>
> In this case you're depending on other software being written adhering
> to certain standards. If you do:
>
> #if HAVE_PID_T
> typedef pid_t rb_pid_t;
> #else
> typedef int rb_pid_t;
> #endif
>
> You're not depending on any software defining or redefining anything.
> So, I'd say that's the preferred way to do it.
>
> All this said, I downloaded a ruby snapshot yesterday (given that the
> CVS service is still down). There are very few ruby internals which
> refer to the pid_t type, so it will be a minimal patch to define an
> rb_pid_t.
>
> bye,
>
>
> Erik.
>
Attachments (1)
? 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 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])
+
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,
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 07:45:02 -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 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(),
`ret' will be the same value as `pid', and following open() will fail.
In Linux, `int setpgrp(void)' is equivalent to setpgid(0, 0). */
#else
@@ -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 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
+
+#if ! HAVE_GID_T
+ typedef int rb_gid_t;
+#else
+ typedef gid_t rb_gid_t;
+#endif
+
+#if ! 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 07:45:03 -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 07:45:04 -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 07:45:04 -0000
@@ -229,8 +229,9 @@
#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_GID_T 0
+#define HAVE_PID_T 0
+#define HAVE_UID_T 0
#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 07:45:05 -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 07:45:05 -0000
@@ -231,8 +231,9 @@
#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_UID_T 0
+#define HAVE_GID_T 0
+#define HAVE_PID_T 0
#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 07:45:05 -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