On Thu, 28 Jun 2007 10:37:52 +0100
"Dave Shield" <[EMAIL PROTECTED]> wrote:
> On 27/06/07, Mitsuru Chinen <[EMAIL PROTECTED]> wrote:
> > I think it is a bit tricky to define "SIZE_OF_LONG_LONG"
> > for such purpose. How about the attached proposal patch?
> > Please note I haven't test it works or not, as I don't have
> > such an Windows environment.
>
> I don't think this is *quite* right, since:
>
>
> > -#if SIZEOF_LONG != SIZEOF_LONG_LONG
> > +#if (SIZEOF_LONG != SIZEOF_LONG_LONG) || (defined (WIN32) && !defined
> > (mingw32))
>
> relies on SIZEOF_LONG_LONG being defined.
> (I believe that #if tests are evaluated left to right)
>
> Better might be something like:
>
> #if defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG != SIZEOF_LONG_LONG)
>
> possibly with some adjustment of the code that follows.
> (I haven't actually looked at this properly).
Thank you for pointing out!
The attached patch is the revised proposal patch.
I'd like someone who has the reported environment to test this
before submitting to the patch manager as I cannot do it.
Thank you,
----
Mitsuru Chinen <[EMAIL PROTECTED]>
Index: snmplib/snmp_client.c
===================================================================
--- snmplib/snmp_client.c (revision 16563)
+++ snmplib/snmp_client.c (working copy)
@@ -807,13 +807,13 @@
}
}
#endif
-#if SIZEOF_LONG != SIZEOF_LONG_LONG
+#if (defined (WIN32) && !defined (mingw32)) || (defined (SIZEOF_LONG_LONG) &&
(SIZEOF_LONG != SIZEOF_LONG_LONG))
#if defined (WIN32) && !defined (mingw32)
else if (vars->val_len == sizeof(__int64)){
const unsigned __int64 *val_ullong
= (const unsigned __int64 *) value;
#else
- else if (vars->val_len == sizeof(long long)){
+ else if (vars->val_len == sizeof(long long)){
const unsigned long long *val_ullong
= (const unsigned long long *) value;
#endif
Index: win32/net-snmp/net-snmp-config.h.in
===================================================================
--- win32/net-snmp/net-snmp-config.h.in (revision 16563)
+++ win32/net-snmp/net-snmp-config.h.in (working copy)
@@ -933,9 +933,6 @@
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
-/* The size of a `long long', as computed by sizeof. */
-#define SIZEOF_LONG_LONG 8
-
/* The size of a `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
Index: win32/net-snmp/net-snmp-config.h
===================================================================
--- win32/net-snmp/net-snmp-config.h (revision 16563)
+++ win32/net-snmp/net-snmp-config.h (working copy)
@@ -933,9 +933,6 @@
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
-/* The size of a `long long', as computed by sizeof. */
-#define SIZEOF_LONG_LONG 8
-
/* The size of a `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders