Patch 1728247 long long vs int64_t

This is a discussion on Patch 1728247 long long vs int64_t within the SNMP Coders forums, part of the Networking and Network Related category; Patch 1728247 added to types.h: #ifndef HAVE_INTMAX_T #ifdef SIZEOF_LONG_LONG typedef long long int intmax_t; #else typedef long intmax_t; #endif #...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-24-2007
Alex Burger
 
Posts: n/a
Default Patch 1728247 long long vs int64_t


Patch 1728247 added to types.h:

#ifndef HAVE_INTMAX_T
#ifdef SIZEOF_LONG_LONG
typedef long long int intmax_t;
#else
typedef long intmax_t;
#endif
#endif

#ifndef HAVE_INTMAX_T
#ifdef SIZEOF_LONG_LONG
typedef unsigned long long int uintmax_t;
#else
typedef unsigned long uintmax_t;
#endif
#endif

This will not compile with MSVC 6 as *long long* and *unsigned long
long* are not supported. __int64 should be used under Windows. __int64
was is used in snmp_client.c using an #ifdef for WIN32. I think MSVC 7
may support long long, but we are maintaining support for MSVC 6.

I thought that the correct way to fix this was to change:

typedef long long intmax_t;
typedef unsigned long long uintmax_t;

to:

typedef int64_t intmax_t;
typedef uint64_t uintmax_t;

The Windows net-snmp-config.h defines HAVE_UINT64_T, and also has a
typedef of:

typedef unsigned __int64 uint64_t;

Using int64_t and uint64_t compiles fine with Windows and Linux. Is
this the preferred fix or should we just #ifdef Windows again?

Alex


-------------------------------------------------------------------------
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
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:03 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0