Subject: Re: [libssh2] preprocessor warning with LIBSSH2_APINO

Re: [libssh2] preprocessor warning with LIBSSH2_APINO

From: Albert Chin <libssh2-devel_at_mlists.thewrittenword.com>
Date: Tue, 31 Jul 2007 10:42:46 -0500

On Thu, Jul 12, 2007 at 10:43:13AM -0400, James Housley wrote:
> On Jul 12, 2007, at 10:26 AM, Guenter Knauf wrote:
>
> > Hi Jim,
> >>> 200706012030L ?
> >
> >> I would think a LONG would work, or we need to make a second constant
> >> to use, so as not to break the comparison of existing software that
> >> doesn't have the problem with the long.
> > when I'm just going to change this - I think we should also ask for
> > existance of LIBSSH2_APINO since older libssh2 dont have it, right?
> >
> > --- #if defined(USE_LIBSSH2) && (LIBSSH2_APINO >= 200706012030)
> > +++ #if defined(USE_LIBSSH2) && defined(LIBSSH2_APINO) &&
> > (LIBSSH2_APINO >= 200706012030L)
>
> Here is the change I will commit:
>
> Index: include/libssh2.h
> ===================================================================
> RCS file: /cvsroot/libssh2/libssh2/include/libssh2.h,v
> retrieving revision 1.76
> diff -u -r1.76 libssh2.h
> --- include/libssh2.h 9 Jul 2007 22:47:24 -0000 1.76
> +++ include/libssh2.h 12 Jul 2007 14:42:29 -0000
> @@ -80,7 +80,7 @@
> #endif
> #define LIBSSH2_VERSION "0.16-CVS"
> -#define LIBSSH2_APINO 200706151200
> +#define LIBSSH2_APINO 200706151200L
> /* Part of every banner, user specified or not */
> #define LIBSSH2_SSH_BANNER "SSH-2.0-
> libssh2_" LIBSSH2_VERSION

This still presents a problem for the HP-UX 11.x C compiler:
  $ cat a.c
#define LIBSSH2_APINO 200706151200L

#if (LIBSSH2_APINO >= 200706012030L)
int a;
#endif
  $ cc a.c
  cpp: "a.c", line 3: error 4044: Constant literal too large.
  cpp: "a.c", line 3: error 4044: Constant literal too large.

-- 
albert chin (china_at_thewrittenword.com)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-07-31