You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Henrik Vendelbo <hv...@bluprints.com> on 1999/10/14 01:11:50 UTC

getpass win32

VC++ compile of aprlib :

_getch not defined

There is a comment in the code /* no getchar or _getch */ but _getch is used anyway ??

\Henrik


_getch (Win32)

Posted by Henrik Vendelbo <hv...@bluprints.com>.
> > It's still the compiler stating that the function has not been properly  
> >declared. In C++ that is an error. In C it's a warning. But it's
> >significant  though. Some other time it might be a function that returns  
> >something else but int. If the returned value is passed on the stack the
> >byteorder could very well screw up the value.
> 
> I assume you are talking about _getch here.  The best thing I can
> recommend, is looking at the help files for _getch.  I know it is declared
> in a header file provided with Windows.  I do not have VC5.0 at home, or I
> could do this this weekend.  I tend to think, that we have an #ifdef HAVE_FOO_H


In general.h I see :

#ifdef WIN32
#include "apr_win.h"
#include <windows.h>
#else
#include "apr_config.h"
#endif

should we use the Win32 api conio.h to get _getch in there ?
-or-
is it just a bad choice of function. stdio.h includes getchar(). Don't they behave the same way ?

> > 
> > I have another compile-error :
> > proc.c
> This was a problem that was caused due to merging a bunch of code.  I have
> fixed this.

Which are the correct ones, those with const char* ?

\Henrik


Re: _getch (Win32)

Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
> In general.h I see :
> 
> #ifdef WIN32
> #include "apr_win.h"
> #include <windows.h>
> #else
> #include "apr_config.h"
> #endif

You missed 
#ifdef HAVE_CONIO_h
#include <conio.h>
#endif

Change the _h to _H and define this in your project.  I'll fix it for real
tomorrow or Monday, depending on when I go to the office.

> 
> should we use the Win32 api conio.h to get _getch in there ?
> -or-
> is it just a bad choice of function. stdio.h includes getchar(). Don't they behave the same way ?

_getch will work, just make the mods I specified above.  I don't know
offhand why we cose _getch, I just know we did.  :)

> Which are the correct ones, those with const char* ?

Yep.


Ryan
_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	


_getch (Win32)

Posted by Henrik Vendelbo <hv...@bluprints.com>.
> > It's still the compiler stating that the function has not been properly  
> >declared. In C++ that is an error. In C it's a warning. But it's
> >significant  though. Some other time it might be a function that returns  
> >something else but int. If the returned value is passed on the stack the
> >byteorder could very well screw up the value.
> 
> I assume you are talking about _getch here.  The best thing I can
> recommend, is looking at the help files for _getch.  I know it is declared
> in a header file provided with Windows.  I do not have VC5.0 at home, or I
> could do this this weekend.  I tend to think, that we have an #ifdef HAVE_FOO_H


In general.h I see :

#ifdef WIN32
#include "apr_win.h"
#include <windows.h>
#else
#include "apr_config.h"
#endif

should we use the Win32 api conio.h to get _getch in there ?
-or-
is it just a bad choice of function. stdio.h includes getchar(). Don't they behave the same way ?

> > 
> > I have another compile-error :
> > proc.c
> This was a problem that was caused due to merging a bunch of code.  I have
> fixed this.

Which are the correct ones, those with const char* ?

\Henrik


Re: Sv: getpass win32

Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
On Sat, 16 Oct 1999, Henrik Vendelbo wrote:

> It's still the compiler stating that the function has not been properly  
>declared. In C++ that is an error. In C it's a warning. But it's
>significant  though. Some other time it might be a function that returns  
>something else but int. If the returned value is passed on the stack the
>byteorder could very well screw up the value.

I assume you are talking about _getch here.  The best thing I can
recommend, is looking at the help files for _getch.  I know it is declared
in a header file provided with Windows.  I do not have VC5.0 at home, or I
could do this this weekend.  I tend to think, that we have an 

#ifdef HAVE_FOO_H
...
#endif
surrounding the needed header file, and that isn't being declared
anywhere.  It used to be that I declared all of the HAVE_FOO_H symbols
that Windows needs in the project file.  That may no longer be true.  If
this can wait until Monday, I will fix it then.  If not, figure out which
header file has this function defined, and add the appropriate #define to
the project file.

> 
> I have another compile-error :
> proc.c
> .\threadproc\win32\proc.c(174) : error C2059: syntax error : '<<'
> .\threadproc\win32\proc.c(404) : error C2143: syntax error : missing '{' before
> '>>'
> .\threadproc\win32\proc.c(404) : error C2059: syntax error : '>>'
> NMAKE : fatal error U1077: 'C:\PROGRAMMER\DEVSTUDIO\VC\BIN\cl.exe' : return code
>  '0x2'
> Stop.
> 
> is this a known problem?

This was a problem that was caused due to merging a bunch of code.  I have
fixed this.


Ryan

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	


Sv: getpass win32

Posted by Henrik Vendelbo <hv...@bluprints.com>.
It's still the compiler stating that the function has not been properly declared. In C++ that is an error. In C it's a warning. But it's significant though. Some other time it might be a function that returns something else but int. If the returned value is passed on the stack the byteorder could very well screw up the value.

I have another compile-error :
proc.c
.\threadproc\win32\proc.c(174) : error C2059: syntax error : '<<'
.\threadproc\win32\proc.c(404) : error C2143: syntax error : missing '{' before
'>>'
.\threadproc\win32\proc.c(404) : error C2059: syntax error : '>>'
NMAKE : fatal error U1077: 'C:\PROGRAMMER\DEVSTUDIO\VC\BIN\cl.exe' : return code
 '0x2'
Stop.

is this a known problem?

\Henrik
 
> Please look at the code again.  The comment you are mentioning, is at the
> end of a #ifdef.  The Windows section is between #else and #endif.
> Windows does have an _getch.  The comment refers to why the #ifdef was
> needed, not what the code directly preceeding it is for.  This is a common
> practice in Apache code, and in fact in most of the code that I have ever
> seen.
Got it, thanx.




Re: getpass win32

Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
Please look at the code again.  The comment you are mentioning, is at the
end of a #ifdef.  The Windows section is between #else and #endif.
Windows does have an _getch.  The comment refers to why the #ifdef was
needed, not what the code directly preceeding it is for.  This is a common
practice in Apache code, and in fact in most of the code that I have ever
seen.

Ryan

On Thu, 14 Oct 1999, Henrik Vendelbo wrote:

> VC++ compile of aprlib :
> 
> _getch not defined
> 
> There is a comment in the code /* no getchar or _getch */ but _getch is used anyway ??
> 
> \Henrik
> 

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.