RE: PATCH: rename int64 to gw_int64 (was PATCH: only typedef int64if type does not already exist)

"Bostock James" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <84E219D8B81E5F4688C4A8992426CD83013D81CA@fr-par-mail01.comverse.com>
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
> >
kannel.int64-3.patch (application/octet-stream, 795 B)
Index: gw/smsc/smsc_soap.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_soap.c,v
retrieving revision 1.20
diff -u -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 07:33:03 -0000
@@ -120,6 +120,7 @@
 
 #include "gwlib/gwlib.h"
 #include "gwlib/http.h"
+#include "gwlib/gw_uuid_types.h"
 #include "smscconn.h"
 #include "smscconn_p.h"
 #include "bb_smscconn_cb.h"
@@ -223,7 +224,7 @@
 /* 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;
+typedef __s64 int64;
  
 /*
  * SOAP module public API towards bearerbox
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.