Re: Config.h and pid redefinition...

2007-12-15 Thread Alberto Santini
Hello Eli.

On Dec 15, 2007 2:58 PM, Eli Zaretskii [EMAIL PROTECTED] wrote:
  Date: Sun, 9 Dec 2007 09:49:55 +0100
  From: Alberto Santini [EMAIL PROTECTED]
 
I modified config.h.W32 commenting the line 412:
#define pid_t int
   
So it would be better to add a conditional definition because there is
a difference between gcc 3.4.x and gcc 4.2.1.
  
   Could you please explain what is that difference?  Does GCC 4.2.1
   somehow define pid_t internally?
 
  In sys/types.h (line 75 - 4.2.1) we have
 
  #ifndef _PID_T_
  #define   _PID_T_
  typedef int   _pid_t;
 
  #ifndef   _NO_OLDNAMES
  typedef _pid_tpid_t;
  #endif
  #endif/* Not _PID_T_ */

 Thanks.  Could you please try the patch below, and see if it fixes
 your original problem?

No, it doesn't work, because config.h (see make.h, for instance) is
loaded before sys/types.h

However the error is at line 75:

#ifndef   _NO_OLDNAMES
typedef _pid_tpid_t; /* THIS IS THE LINE 75 */
#endif

I defined _NO_OLDNAMES, but there are other errors.

I think the solution is using GCC_VERSION. :(


 2007-12-15  Eli Zaretskii  [EMAIL PROTECTED]

* config.h.W32 [!_PID_T_] (pid_t): Define only if not already
defined.

 --- config.h.W32~0  2006-04-01 12:42:38.0 +0300
 +++ config.h.W322007-12-15 15:54:35.598803300 +0200
 @@ -409,7 +409,10 @@
  #define gid_t int

  /* Define to `int' if sys/types.h does not define. */
 +/* GCC 4.x reportedly defines pid_t.  */
 +#ifndef _PID_T_
  #define pid_t int
 +#endif

  /* Define to `int' if sys/types.h doesn't define. */
  #define uid_t int


Ciao,
Alberto


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: Config.h and pid redefinition...

2007-12-15 Thread Eli Zaretskii
 Date: Sat, 15 Dec 2007 18:23:55 +0100
 From: Alberto Santini [EMAIL PROTECTED]
 Cc: bug-make@gnu.org
 
  Thanks.  Could you please try the patch below, and see if it fixes
  your original problem?
 
 No, it doesn't work, because config.h (see make.h, for instance) is
 loaded before sys/types.h

Yes, that was silly of me.  How about the patch below, then?

 I think the solution is using GCC_VERSION. :(

I don't want to use GCC_VERSION, because then I'd need to know exactly
which version started defining pid_t.

2007-12-15  Eli Zaretskii  [EMAIL PROTECTED]

* config.h.W32: Include sys/types.h.
[!_PID_T_] (pid_t): Define only if not already defined.

--- config.h.W32~0  2006-04-01 12:42:38.0 +0300
+++ config.h.W322007-12-16 06:13:06.03550 +0200
@@ -405,11 +405,16 @@
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
 
+#include sys/types.h
+
 /* Define to `int' if sys/types.h doesn't define. */
 #define gid_t int
 
 /* Define to `int' if sys/types.h does not define. */
+/* GCC 4.x reportedly defines pid_t.  */
+#ifndef _PID_T_
 #define pid_t int
+#endif
 
 /* Define to `int' if sys/types.h doesn't define. */
 #define uid_t int


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


Re: Config.h and pid redefinition...

2007-12-15 Thread Eli Zaretskii
 Date: Sun, 9 Dec 2007 09:49:55 +0100
 From: Alberto Santini [EMAIL PROTECTED]
 
   I modified config.h.W32 commenting the line 412:
   #define pid_t int
  
   So it would be better to add a conditional definition because there is
   a difference between gcc 3.4.x and gcc 4.2.1.
 
  Could you please explain what is that difference?  Does GCC 4.2.1
  somehow define pid_t internally?
 
 In sys/types.h (line 75 - 4.2.1) we have
 
 #ifndef _PID_T_
 #define   _PID_T_
 typedef int   _pid_t;
 
 #ifndef   _NO_OLDNAMES
 typedef _pid_tpid_t;
 #endif
 #endif/* Not _PID_T_ */

Thanks.  Could you please try the patch below, and see if it fixes
your original problem?

2007-12-15  Eli Zaretskii  [EMAIL PROTECTED]

* config.h.W32 [!_PID_T_] (pid_t): Define only if not already
defined.

--- config.h.W32~0  2006-04-01 12:42:38.0 +0300
+++ config.h.W322007-12-15 15:54:35.598803300 +0200
@@ -409,7 +409,10 @@
 #define gid_t int
 
 /* Define to `int' if sys/types.h does not define. */
+/* GCC 4.x reportedly defines pid_t.  */
+#ifndef _PID_T_
 #define pid_t int
+#endif
 
 /* Define to `int' if sys/types.h doesn't define. */
 #define uid_t int


___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make