You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Sam TH <sa...@uchicago.edu> on 2000/12/03 08:24:26 UTC

isascii on BeOS PPC

More fun with the BeOS.  First, could someone apply the patch I posted to update the -I directories.  Thanks.

Second, since Subversion needs isascii() in a few places, I moved the ifdef that makes it work on the BeOS PPC into apr_lib.h (where all the other isascii() stuff is) from networkio.h.  

Both patches are in the attached file.  

           
	sam th		     
	sam@uchicago.edu
	http://www.abisource.com/~sam/
	GnuPG Key:  
	http://www.abisource.com/~sam/key

Re: isascii on BeOS PPC

Posted by rb...@covalent.net.
> > First of all, Sam could you please post patches in line?  It makes them
> > much easier to reply to.  Thanks.
> 
> Sure.  Sorry about that. 

No problem, information like this needs to go on the site, I'll try
to update it all today.  :-)

> >  INCDIR=../../include
> >  OSDIR=$(INCDIR)/arch/@OSDIR@
> >  DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
> > -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
> > +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I../unix/
> >  MKDEP=../../helpers/mkdep.sh
> >  
> >  LIB=libnetwork.a
> > 
> > Why is this needed?  There are no header files in network_io/unix, so
> > adding -I../unix/ shouldn't add anything here.  Could you please make sure
> > that you are working with an up-to-date repository?
> 
> You would think so, wouldn't you?  But someone decided to be tricky
> and include a .c file (sa_common.c) in sockaddr.c, so the additional
> include directory is neccessary.

EWWWWW!  Can we find some other way to do this?  Like referencing the
correct file in the Makefile?  I really dislike this idea.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: isascii on BeOS PPC

Posted by Sam TH <sa...@uchicago.edu>.
On Sat, Dec 02, 2000 at 11:33:55PM -0800, rbb@covalent.net wrote:
> 
> First of all, Sam could you please post patches in line?  It makes them
> much easier to reply to.  Thanks.

Sure.  Sorry about that. 

> 
> Now, quick question.
> 
> Index: network_io/beos/Makefile.in
> ===================================================================
> RCS file: /home/cvspublic/apr/network_io/beos/Makefile.in,v
> retrieving revision 1.14
> diff -u -r1.14 Makefile.in
> --- network_io/beos/Makefile.in	2000/11/18 16:53:18	1.14
> +++ network_io/beos/Makefile.in	2000/12/03 07:21:51
> @@ -6,7 +6,7 @@
>  INCDIR=../../include
>  OSDIR=$(INCDIR)/arch/@OSDIR@
>  DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
> -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
> +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I../unix/
>  MKDEP=../../helpers/mkdep.sh
>  
>  LIB=libnetwork.a
> 
> Why is this needed?  There are no header files in network_io/unix, so
> adding -I../unix/ shouldn't add anything here.  Could you please make sure
> that you are working with an up-to-date repository?

You would think so, wouldn't you?  But someone decided to be tricky
and include a .c file (sa_common.c) in sockaddr.c, so the additional
include directory is neccessary.

           
	sam th		     
	sam@uchicago.edu
	http://www.abisource.com/~sam/
	GnuPG Key:  
	http://www.abisource.com/~sam/key

Re: isascii on BeOS PPC

Posted by Greg Stein <gs...@lyra.org>.
Ryan was discussing how that would be hard to use within apr_lib.h because
we'd need to include apr_private.h to get the config variable. etc etc

I didn't even know that check was in there, and figured the quick patch was
sufficient. Please feel free to fix it:

  1) update the #if stuff in apr_lib
or
  2) add logic to propagate the HAVE_isascii to APR_HAVE_isascii in apr.h

Essentially, that fix may have reached configure.in, but it didn't make it
to the apr_lib.h header.

Cheers,
-g

On Sun, Dec 03, 2000 at 01:18:01PM -0000, David Reid wrote:
> OK!  Timeout!
> 
> Can we please have a moment of sanity.  Why are we hard coding this?
> 
> >From configure.in...
> 
> AC_CHECK_DEFINE(isascii, ctype.h)
> 
> 
> We already have a check in configure so can we please use this???  I'll
> patch it in a while.  This was addressed for PPC compilation on BeOS at the
> very beginning of APR development... <sigh>
> 
> Sam, the folks at Be know about this omission from ctype.h in PPC R4.5 and
> it was fixed in R5, which is why it makes sense to have it as a configure
> time check than hard coding it.
> 
> david
> 
> > > +#if BEOS && __POWER_PC__
> > > +#define isascii(c) (((c) & ~0x7f)==0)
> > > +#endif
> 

-- 
Greg Stein, http://www.lyra.org/

Re: isascii on BeOS PPC

Posted by Greg Stein <gs...@lyra.org>.
Applied. Thanks!

On Sun, Dec 03, 2000 at 02:10:08AM -0600, Sam TH wrote:
>...
> --- apr_lib.h	2000/11/26 03:00:01	1.44
> +++ apr_lib.h	2000/12/03 08:09:37
> @@ -113,6 +113,9 @@
>  #define apr_isdigit(c) (isdigit(((unsigned char)(c))))
>  #define apr_isgraph(c) (isgraph(((unsigned char)(c))))
>  #define apr_islower(c) (islower(((unsigned char)(c))))
> +#if BEOS && __POWER_PC__
> +#define isascii(c) (((c) & ~0x7f)==0)
> +#endif 
>  #define apr_isascii(c) (isascii(((unsigned char)(c))))
>  #define apr_isprint(c) (isprint(((unsigned char)(c))))
>  #define apr_ispunct(c) (ispunct(((unsigned char)(c))))

-- 
Greg Stein, http://www.lyra.org/

Re: isascii on BeOS PPC

Posted by Greg Stein <gs...@lyra.org>.
On Sun, Dec 03, 2000 at 02:10:08AM -0600, Sam TH wrote:
>...
> --- apr_lib.h	2000/11/26 03:00:01	1.44
> +++ apr_lib.h	2000/12/03 08:09:37
> @@ -113,6 +113,9 @@
>  #define apr_isdigit(c) (isdigit(((unsigned char)(c))))
>  #define apr_isgraph(c) (isgraph(((unsigned char)(c))))
>  #define apr_islower(c) (islower(((unsigned char)(c))))
> +#if BEOS && __POWER_PC__
> +#define isascii(c) (((c) & ~0x7f)==0)
> +#endif 
>  #define apr_isascii(c) (isascii(((unsigned char)(c))))
>  #define apr_isprint(c) (isprint(((unsigned char)(c))))
>  #define apr_ispunct(c) (ispunct(((unsigned char)(c))))

Seems fine now, but I'd move it just outside of the block of the apr_is*
functions. Aesthetically nicer :-)

If Ryan doesn't apply this soon-ish (dunno if he is still on line), then
I'll do it in a while.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: isascii on BeOS PPC

Posted by Sam TH <sa...@uchicago.edu>.
On Sat, Dec 02, 2000 at 11:40:37PM -0800, rbb@covalent.net wrote:
> 
> Second question about this patch,
> 
> Index: include/apr_lib.h
> ===================================================================
> RCS file: /home/cvspublic/apr/include/apr_lib.h,v
> retrieving revision 1.44
> diff -u -r1.44 apr_lib.h
> --- include/apr_lib.h	2000/11/26 03:00:01	1.44
> +++ include/apr_lib.h	2000/12/03 07:21:44
> @@ -113,6 +113,9 @@
>  #define apr_isdigit(c) (isdigit(((unsigned char)(c))))
>  #define apr_isgraph(c) (isgraph(((unsigned char)(c))))
>  #define apr_islower(c) (islower(((unsigned char)(c))))
> +#if !HAVE_isascii
> +#define isascii(c) (((c) & ~0x7f)==0)
> +#endif 
>  #define apr_isascii(c) (isascii(((unsigned char)(c))))
>  #define apr_isprint(c) (isprint(((unsigned char)(c))))
>  #define apr_ispunct(c) (ispunct(((unsigned char)(c))))
> Index: network_io/beos/networkio.h
> ===================================================================
> RCS file: /home/cvspublic/apr/network_io/beos/networkio.h,v
> retrieving revision 1.18
> diff -u -r1.18 networkio.h
> --- network_io/beos/networkio.h	2000/08/02 05:26:26	1.18
> +++ network_io/beos/networkio.h	2000/12/03 07:21:52
> @@ -78,9 +78,6 @@
>   *
>   * It will be included in the next release, but until then... 
>   */
> -#if !HAVE_isascii
> -#define isascii(c) (((c) & ~0x7f)==0)
> -#endif
>  
>  #include "apr_general.h"
> 
> Could you try just using apr_isascii instead of isascii?  We can't put
> isascii in apr_lib.h, because some platforms actually have that macro.  We
> also can't put HAVE_isascii in apr_lib.h, because that would require
> putting #include apr_private.h in a public header so that the definition
> of HAVE_isascii is found.  Unfortunately, autoconf doesn't let us
> name-space protect the macros it generates, so we can't include
> apr_private.h in a public header, because then any program that used
> autoconf couldn't use APR.  :-(

Well, the problem is that isacii doesn't exist at all in the system
headers.  And so using apr_isascii, which is just a wrapper around
isascii, doesn't help.  However, I think the easiest way to do that is
to just change 

#if !HAVE_isascii 
to 
#if BEOS && __POWER_PC__

which is where the problem occurs.  Of course, this doesn't solve the
general problem of providing isascii to systems that don't have it,
but it does fix the problem at hand.

So the new patch is:

Index: apr_lib.h
===================================================================
RCS file: /home/cvspublic/apr/include/apr_lib.h,v
retrieving revision 1.44
diff -u -r1.44 apr_lib.h
--- apr_lib.h	2000/11/26 03:00:01	1.44
+++ apr_lib.h	2000/12/03 08:09:37
@@ -113,6 +113,9 @@
 #define apr_isdigit(c) (isdigit(((unsigned char)(c))))
 #define apr_isgraph(c) (isgraph(((unsigned char)(c))))
 #define apr_islower(c) (islower(((unsigned char)(c))))
+#if BEOS && __POWER_PC__
+#define isascii(c) (((c) & ~0x7f)==0)
+#endif 
 #define apr_isascii(c) (isascii(((unsigned char)(c))))
 #define apr_isprint(c) (isprint(((unsigned char)(c))))
 #define apr_ispunct(c) (ispunct(((unsigned char)(c))))
       
	sam th		     
	sam@uchicago.edu
	http://www.abisource.com/~sam/
	GnuPG Key:  
	http://www.abisource.com/~sam/key

Re: isascii on BeOS PPC

Posted by rb...@covalent.net.
Second question about this patch,

Index: include/apr_lib.h
===================================================================
RCS file: /home/cvspublic/apr/include/apr_lib.h,v
retrieving revision 1.44
diff -u -r1.44 apr_lib.h
--- include/apr_lib.h	2000/11/26 03:00:01	1.44
+++ include/apr_lib.h	2000/12/03 07:21:44
@@ -113,6 +113,9 @@
 #define apr_isdigit(c) (isdigit(((unsigned char)(c))))
 #define apr_isgraph(c) (isgraph(((unsigned char)(c))))
 #define apr_islower(c) (islower(((unsigned char)(c))))
+#if !HAVE_isascii
+#define isascii(c) (((c) & ~0x7f)==0)
+#endif 
 #define apr_isascii(c) (isascii(((unsigned char)(c))))
 #define apr_isprint(c) (isprint(((unsigned char)(c))))
 #define apr_ispunct(c) (ispunct(((unsigned char)(c))))
Index: network_io/beos/networkio.h
===================================================================
RCS file: /home/cvspublic/apr/network_io/beos/networkio.h,v
retrieving revision 1.18
diff -u -r1.18 networkio.h
--- network_io/beos/networkio.h	2000/08/02 05:26:26	1.18
+++ network_io/beos/networkio.h	2000/12/03 07:21:52
@@ -78,9 +78,6 @@
  *
  * It will be included in the next release, but until then... 
  */
-#if !HAVE_isascii
-#define isascii(c) (((c) & ~0x7f)==0)
-#endif
 
 #include "apr_general.h"

Could you try just using apr_isascii instead of isascii?  We can't put
isascii in apr_lib.h, because some platforms actually have that macro.  We
also can't put HAVE_isascii in apr_lib.h, because that would require
putting #include apr_private.h in a public header so that the definition
of HAVE_isascii is found.  Unfortunately, autoconf doesn't let us
name-space protect the macros it generates, so we can't include
apr_private.h in a public header, because then any program that used
autoconf couldn't use APR.  :-(

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: isascii on BeOS PPC

Posted by rb...@covalent.net.
First of all, Sam could you please post patches in line?  It makes them
much easier to reply to.  Thanks.

Now, quick question.

Index: network_io/beos/Makefile.in
===================================================================
RCS file: /home/cvspublic/apr/network_io/beos/Makefile.in,v
retrieving revision 1.14
diff -u -r1.14 Makefile.in
--- network_io/beos/Makefile.in	2000/11/18 16:53:18	1.14
+++ network_io/beos/Makefile.in	2000/12/03 07:21:51
@@ -6,7 +6,7 @@
 INCDIR=../../include
 OSDIR=$(INCDIR)/arch/@OSDIR@
 DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
-INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
+INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I../unix/
 MKDEP=../../helpers/mkdep.sh
 
 LIB=libnetwork.a

Why is this needed?  There are no header files in network_io/unix, so
adding -I../unix/ shouldn't add anything here.  Could you please make sure
that you are working with an up-to-date repository?

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------