Hi,

ok, as we require C99 compiler now long long is defined type and is at least 64bit width. Please check attached patch that just converts all int64 into long long.

Thanks,
Alex

Bostock James schrieb:
Hi,

You could say the same about defining int64, couldn't you?

Your patch does not work because on AIX the int64 type is a typedef and
so does not introduce a preprocessor symbol that #ifndef can check.

How about the attached patch that #includes gwlib/gw_uuid_types.h and
then uses __s64 for the typedef?

Since Kannel requires a C99 compiler, maybe both the configure script,
gw_uuid_types.h and smsc_soap.c could use the types defined in
inttypes.h.

Regards,

James

-----Original Message-----
From: Alexander Malysh

Hi,

I don't like this patch. we should not define any gw_intXX.
Will attached patch work?

Thanks,
Alex

Bostock James schrieb:
Hi,

Given the lack of responses to my request for comments earlier, I
have
created a new patch (attached) that simply renames the int64 type
defined in smsc_soap.c to gw_int64.

This patch fixes a compilation error when building Kannel in 64 bit
mode
on AIX 5.2.

Regards,

James

From: Bostock James
Sent: 11 July 2008 10:43

From: Stipe Tolj
Sent: 10 July 2008 17:06

Bostock James schrieb:
Hi,

The attached patch causes the int64 type to only be defined (in
gw/smsc/smsc_soap.c) if it does not already exist (as determined
by
the
autoconf AC_CHECK_TYPES macro). This patch fixes a compilation
failure
on AIX when compiling in 64 bit mode.
first of all thanks a lot James, we appreciate your work highly.

hmmm, -0 on the patch. Reason: I don't like the idea to have

   #define HAVE_<TYPE>

statements in the gw-config.h.in autoconf macro.

It might be overkill but one option would be to add a separate
header
file in the gw/smsc directory with the #define HAVE_<TYPE>.
Something
similar has already been done in gwlib (gw_uuid_types.h.in).

Or maybe the __s64 type defined in gw_uuid_types.h could be used.

I am not sure how portable using int64_t is, otherwise I would
suggest
that.

Comments?

-james


Index: gw/smsc/smsc_soap.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_soap.c,v
retrieving revision 1.20
diff -a -u -p -r1.20 smsc_soap.c
--- gw/smsc/smsc_soap.c 10 Mar 2008 09:37:42 -0000      1.20
+++ gw/smsc/smsc_soap.c 29 Jul 2008 11:34:20 -0000
@@ -223,8 +223,7 @@ typedef struct argument_map {
 /* useful macros go here (some of these were ripped of other modules,
    so maybe its better to put them in a shared file) */
 #define        O_DESTROY(a)    { if(a) octstr_destroy(a); a=NULL; }
-typedef long long int64;
- 
+
 /*
  * SOAP module public API towards bearerbox
  */
@@ -265,7 +264,7 @@ static void soap_read_response(SMSCConn 
 static Octstr *soap_format_xml(Octstr *xml_file, Msg *msg, PrivData *privdata);
 /* parse a response from the SOAP server to get the message ID */
 
-static int64 soap_parse_response(PrivData *privdata, Octstr *xmlResponse);
+static long long soap_parse_response(PrivData *privdata, Octstr *xmlResponse);
 /* parse an incoming MO xml */
 static long soap_parse_mo(SMSCConn *conn, Octstr *request, Octstr **response);
 /* parse an incoming derlivery report */
@@ -277,7 +276,7 @@ static long soap_parse_dlr(SMSCConn *con
 /* parse an integer out of a XML node */
 int soap_xmlnode_get_long(xmlNodePtr cur, long *out);
 /* parse an int64 out of a XML node */
-int soap_xmlnode_get_int64(xmlNodePtr cur, int64 *out);
+int soap_xmlnode_get_int64(xmlNodePtr cur, long long *out);
 /* parse a string out of a XML node */
 int soap_xmlnode_get_octstr(xmlNodePtr cur, Octstr **out);
 /* convert a one2one date format to epoch time */
@@ -1123,7 +1122,7 @@ static void soap_read_response(SMSCConn 
     Octstr *responseBody, *responseURL;
     List* responseHeaders;
     int responseStatus;
-    int64 msgID;
+    long long msgID;
     ClientData* cd;
 
     /* don't get in here unless I have some callers */
@@ -1203,9 +1202,9 @@ static void soap_read_response(SMSCConn 
  *                but if gwlist_get() returns NULL for an empty item, things 
might break - and
  *                not in a nice way.
  **/
-static int64 soap_parse_response(PrivData* privdata, Octstr* xmlResponse)
+static long long soap_parse_response(PrivData* privdata, Octstr* xmlResponse)
 {
-    int64 msgID = -1;
+    long long msgID = -1;
     long responseStatus = -1;
     xmlDocPtr responseDoc;
     xmlNodePtr root;
@@ -1286,7 +1285,7 @@ static long soap_parse_mo(SMSCConn *conn
 
     List* maps;
     char receiver[30], sender[30], msgtype[30], msgdata[255], date[30];
-    int64 msgid = -1;
+    long long msgid = -1;
     char* keywords[] = { "receiver", "sender", "msgtype", "msgdata", "date", 
"id" };
     char* sscans[] = { "%s", "%s", "%s", "%s", "%s", "%lld" };
     void* pointers[] = { &receiver, &sender, &msgtype, &msgdata, &date, &msgid 
};
@@ -1705,12 +1704,12 @@ int soap_xmlnode_get_long(xmlNodePtr cur
 
 /*
  * function soap_xmlnode_get_int64()
- *     parse the content of an XML node and return it as an int64
+ *     parse the content of an XML node and return it as an long long
  * Input: xmlNodePtr to node
  * Output: long parsed
  * Returns: 0 on success, -1 on failure
  **/
-int soap_xmlnode_get_int64(xmlNodePtr cur, int64* out)
+int soap_xmlnode_get_int64(xmlNodePtr cur, long long* out)
 {
     xmlChar* nodeContent;
     char* endPointer;

Reply via email to