patch for u_int8_t [was: pre27 compilation fails on Sol7 box]

Andre Lucas andre.lucas at dial.pipex.com
Tue Jan 18 03:43:44 EST 2000


I got this on HPUX too. The following patch fixed it for me.

BTW all, I am aware that relying on an unsigned char to be 8 bits wide
isn't necessarily a wise thing to do, but it may suffice as the
last-ditch-before-error option that it is. Instead there could be a
SIZEOF_CHAR define. I'm not sure how necessary this is.

Ta,
-Andre

===== begin patch =====
--- openssh-1.2.1pre27/defines.h        Sun Jan 16 22:59:41 2000
+++ openssh-1.2.1pre27.new/defines.h    Mon Jan 17 16:37:16 2000
@@ -78,11 +78,13 @@
 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
 #ifndef HAVE_U_INTXX_T
 # ifdef HAVE_UINTXX_T
+typedef uint8_t u_int8_t;
 typedef uint16_t u_int16_t;
 typedef uint32_t u_int32_t;
 typedef  uint64_t u_int64_t;
 # define HAVE_U_INTXX_T 1
 # else
+typedef unsigned char u_int8_t;
 #  if (SIZEOF_SHORT_INT == 2)
 typedef unsigned short int u_int16_t;
 #  else
===== end patch =====

Ta,
-Andre


Andrew Stribblehill wrote:
> 
> Something strange happens when I compile the pre27 SSH:
> 
> ocal/ssh//include -DETCDIR=\"/usr/local/ssh//etc\" \
> -DSSH_PROGRAM=\"/usr/local/ssh//bin/ssh\" \
> -DSSH_ASKPASS_DEFAULT=\"/usr/local/ssh//libexec/ssh/ssh-askpass\" \
> -DHAVE_CONFIG_H  -c  atomicio.c
> In file included from includes.h:106,
>                  from atomicio.c:26:
>                  fake-socket.h:30: parse error before u_int8_t'
>                  fake-socket.h:30: warning: no semicolon at end of
> struct or union
> fake-socket.h:39: field sin6_addr' has incomplete type
> *** Error code 1
> make: Fatal error: Command failed for target atomicio.o'
> 
> This is indeed bizarre because the bit of code in question is:
> 
> ------->8-----fake-socket.h--starting-at-line-28-------
> #ifndef HAVE_STRUCT_IN6_ADDR
> struct in6_addr {
>     u_int8_t  s6_addr[16];           <------ line 30
> };
> #endif /* !HAVE_STRUCT_IN6_ADDR */
> 
> #ifndef HAVE_STRUCT_SOCKADDR_IN6
> struct sockaddr_in6 {
>    unsigned short sin6_family;
>    u_int16_t sin6_port;
>    u_int32_t sin6_flowinfo;
>    struct in6_addr sin6_addr;       <------- line 39
>    };
> #endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
> ---------8<-------------------------------------------
> 
> which would appear to have the requisite number of semicolons.
> When I comment out line 30, everything compiles.
> 
> Any guesses? Can anyone say for certain that it's _not_ ssh's fault?
> 
> Thanks,
> 
> Andrew Stribblehill
> Systems Programmer, IT Service, University of Durham, England





More information about the openssh-unix-dev mailing list