Hi,

Thanks to all for reviewing my patch!

On Tue, 03 Jul 2007 15:39:04 -0700
Wes Hardaker <[EMAIL PROTECTED]> wrote:

> >>>>> "MC" == Mitsuru Chinen <[EMAIL PROTECTED]> writes:
> 
> MC> Patch 1728247 is created under recognition where the SIZEOF_LONG_LONG
> ...
> MC> I'd like to call for votes to include it in 5.4.1.
> 
> +1 and applied to V5-4-patches and V5-3-patches.  However, it doesn't
> apply as is to the main trunk and it looks like a newer autoconf
> solution based on new macros is used there anyway.  Anyone have a proper
> patch for the main trunk?  I haven't followed the above patch and other
> solutions well enough to trust myself to generate one without much more
> study.

I posted a patch for the main trunk to the patch manager #1746273.
A copy of the patch is the following.
Because it uses a newer autoconf solution as you awared, definitions
related intmax_t should be included in win32/net-snmp/net-snmp-config.h.

Best Regards,
----
Mitsuru Chinen <[EMAIL PROTECTED]>

Index: snmplib/snmp_client.c
===================================================================
--- snmplib/snmp_client.c       (revision 16580)
+++ snmplib/snmp_client.c       (working copy)
@@ -812,16 +812,11 @@
                 }
             }
 #endif
-#if 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)){
+#if defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG != SIZEOF_LONG_LONG)
+#if !defined(SIZEOF_INTMAX_T) || (SIZEOF_LONG_LONG != SIZEOF_INTMAX_T)
+            else if (vars->val_len == sizeof(long long)){
                 const unsigned long long   *val_ullong
                     = (const unsigned long long *) value;
-#endif
                 *(vars->val.integer) = (long) *val_ullong;
                 if (*(vars->val.integer) > 0xffffffff) {
                     snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
@@ -829,6 +824,18 @@
                 }
             }
 #endif
+#endif
+#if defined(SIZEOF_INTMAX_T) && SIZEOF_LONG != SIZEOF_INTMAX_T
+            else if (vars->val_len == sizeof(intmax_t)){
+                const uintmax_t *val_uintmax_t
+                    = (const uintmax_t *) value;
+                *(vars->val.integer) = (long) *val_uintmax_t;
+                if (*(vars->val.integer) > 0xffffffff) {
+                    snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
+                    *(vars->val.integer) &= 0xffffffff;
+                }
+            }
+#endif
 #if SIZEOF_SHORT != SIZEOF_INT
             else if (vars->val_len == sizeof(short)) {
                 if (ASN_INTEGER == vars->type) {
Index: configure.in
===================================================================
--- configure.in        (revision 16580)
+++ configure.in        (working copy)
@@ -1337,6 +1337,7 @@
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(intmax_t)
 AC_TYPE_INT8_T
 AC_TYPE_INT16_T
 AC_TYPE_INT32_T
Index: win32/net-snmp/net-snmp-config.h.in
===================================================================
--- win32/net-snmp/net-snmp-config.h.in (revision 16580)
+++ win32/net-snmp/net-snmp-config.h.in (working copy)
@@ -924,8 +924,8 @@
 /* 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 `intmax_t', as computed by sizeof. */
+#define SIZEOF_INTMAX_T 8
 
 /* The size of a `short', as computed by sizeof. */
 #define SIZEOF_SHORT 2
@@ -1528,6 +1528,8 @@
 typedef long int32_t;
 typedef unsigned __int64 uint64_t;
 typedef __int64 int64_t;
+typedef unsigned __int64 uintmax_t;
+typedef __int64 intmax_t;
 typedef unsigned short   uint16_t;
 
 /* Define if you have the closesocket function.  */
Index: win32/net-snmp/net-snmp-config.h
===================================================================
--- win32/net-snmp/net-snmp-config.h    (revision 16580)
+++ win32/net-snmp/net-snmp-config.h    (working copy)
@@ -924,8 +924,8 @@
 /* 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 `intmax_t', as computed by sizeof. */
+#define SIZEOF_INTMAX_T 8
 
 /* The size of a `short', as computed by sizeof. */
 #define SIZEOF_SHORT 2
@@ -1528,6 +1528,8 @@
 typedef long int32_t;
 typedef unsigned __int64 uint64_t;
 typedef __int64 int64_t;
+typedef unsigned __int64 uintmax_t;
+typedef __int64 intmax_t;
 typedef unsigned short   uint16_t;
 
 /* Define if you have the closesocket function.  */

-------------------------------------------------------------------------
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

Reply via email to