[Gcl-devel] Re: windows-only read patch (was: error in ./configure when building gcl 2.6.7 onUbuntu)



Greetings!

"Vadim V. Zhytnikov" <vvzhy at netorn.ru> writes:

> Camm Maguire writes:
> > Greetings!  Any progress here?
> 
> I only can confirm that removing WIN32 conditional
> below really breaks build on Windows.
> 
> >>>> +++ read.d	16 Jun 2006 02:26:22 -0000	
> >>>> 1.14.4.1.2.2.2.4.6.1.6.1.4.3
> >>>> @@ -256,6 +256,7 @@
> >>>>  
> >>>>  	x = read_object(in);
> >>>>  	vs_push(x);
> >>>> +#ifndef _WIN32
> >>>>  	while (listen_stream(in)) {
> >>>>  	  object c=read_char(in);
> >>>>  	  if (cat(c)!=cat_whitespace) {
> >>>> @@ -263,7 +264,7 @@
> >>>>  	    break;
> >>>>  	  }
> >>>>  	}
> >>>> -
> >>>> +#endif
> >>>>  	if (sharp_eq_context_max > 0)
> >>>>  		x = vs_head = patch_sharp(x);
> >>>>  
> 
> 

Thanks Vadim!  Is there a way, in windows, to determine if data is
ready for reading in from a terminal interface?  The FIONREAD ioctl
works on linux, and there is the following non-blocking generic code
which appears in force on windows:

#ifdef LISTEN_USE_FCNTL
  do { int c = 0;
  FILE *fp = strm->sm.sm_fp;
  int orig;
  int res;
  if (feof(fp)) return TRUE;
  orig = fcntl(fileno(fp), F_GETFL);
  if (! (orig & O_NONBLOCK ) ) {
    res=fcntl(fileno(fp),F_SETFL,orig | O_NONBLOCK);
  }
  c = getc(fp);
  if (! (orig & O_NONBLOCK ) ){
    fcntl(fileno(fp),F_SETFL,orig );
  }
  if (c != EOF)
    { 
      ungetc(c,fp);
      return TRUE;
    }
  return FALSE;
  } while (0);
#endif

that is, presuming the configure check

check for listen using fcntl

returns yes.  Can you tell me if the latter is true or not, and then
if so, what are the symptoms of breakage in light of the code above?

Thanks so much!

Take care,


> -- 
>       Vadim V. Zhytnikov
> 
>        <vvzhy at mail.ru>
>       <vvzhy at netorn.ru>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
> 
> 
> 

-- 
Camm Maguire			     			camm at enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah