aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-04-25 03:00:10 +0000
committerYang Tse <yangsita@gmail.com>2007-04-25 03:00:10 +0000
commit94b253fde793a7419f0eafe16b24f440d344a1c9 (patch)
tree535b51278396773021d65c7df0a81dd7a359d7a0
parent61d7e720a58bef33e46b300c70ad88793801e077 (diff)
Steve Little's fixes to allow compilation on VMS 64-bit mode
-rw-r--r--CHANGES3
-rw-r--r--RELEASE-NOTES3
-rw-r--r--ares/setup_once.h21
-rw-r--r--lib/base64.c4
-rw-r--r--lib/hostip.c16
-rw-r--r--lib/netrc.c4
-rw-r--r--lib/setup_once.h21
-rw-r--r--lib/splay.c4
-rwxr-xr-xpackages/vms/build_vms.com17
-rw-r--r--src/main.c2
10 files changed, 81 insertions, 14 deletions
diff --git a/CHANGES b/CHANGES
index 2c07187bb..404b9b018 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@
Changelog
+Yang Tse (25 April 2007)
+- Steve Little fixed compilation on VMS 64-bit mode
+
Daniel S (24 April 2007)
- Robert Iakobashvili made the 'master_buffer' get allocated first once it is
can/will be used as it then makes the common cases save 16KB of data for each
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 863ed8fbf..99fddefe1 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -28,6 +28,7 @@ This release includes the following bugfixes:
o GnuTLS free of NULL credentials
o NSS-fix for closing down SSL
o bad warning from configure when gnutls was selected
+ o compilation on VMS 64-bit mode
This release includes the following known bugs:
@@ -49,6 +50,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these:
Song Ma, Dan Fandrich, Yang Tse, Jay Austin, Robert Iakobashvil,
- James Housley, Daniel Black
+ James Housley, Daniel Black, Steve Little
Thanks! (and sorry if I forgot to mention someone)
diff --git a/ares/setup_once.h b/ares/setup_once.h
index c80fc32d9..4f7ed59bb 100644
--- a/ares/setup_once.h
+++ b/ares/setup_once.h
@@ -337,5 +337,26 @@ typedef int sig_atomic_t;
#endif
+/*
+ * Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid()
+ */
+
+#if defined(VMS) && \
+ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
+#define getpwuid __32_getpwuid
+#endif
+
+
+/*
+ * Macro argv_item_t hides platform details to code using it.
+ */
+
+#ifdef VMS
+#define argv_item_t __char_ptr32
+#else
+#define argv_item_t char *
+#endif
+
+
#endif /* __SETUP_ONCE_H */
diff --git a/lib/base64.c b/lib/base64.c
index a46d1f762..302d49885 100644
--- a/lib/base64.c
+++ b/lib/base64.c
@@ -252,7 +252,7 @@ size_t Curl_base64_encode(struct SessionHandle *data,
#define TEST_NEED_SUCK
void *suck(int *);
-int main(int argc, char **argv, char **envp)
+int main(int argc, argv_item_t argv[], char **envp)
{
char *base64;
size_t base64Len;
@@ -293,7 +293,7 @@ int main(int argc, char **argv, char **envp)
#define TEST_NEED_SUCK
void *suck(int *);
-int main(int argc, char **argv, char **envp)
+int main(int argc, argv_item_t argv[], char **envp)
{
char *base64;
int base64Len;
diff --git a/lib/hostip.c b/lib/hostip.c
index 399ac53e5..9fb157fd3 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -598,6 +598,14 @@ struct namebuf {
Curl_addrinfo *Curl_ip2addr(in_addr_t num, const char *hostname, int port)
{
Curl_addrinfo *ai;
+
+#if defined(VMS) && \
+ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
+#pragma pointer_size save
+#pragma pointer_size short
+#pragma message disable PTRMISMATCH
+#endif
+
struct hostent *h;
struct in_addr *addrentry;
struct namebuf buffer;
@@ -624,10 +632,16 @@ Curl_addrinfo *Curl_ip2addr(in_addr_t num, const char *hostname, int port)
/* Now store the dotted version of the address */
snprintf((char *)h->h_name, 16, "%s", hostname);
+#if defined(VMS) && \
+ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
+#pragma pointer_size restore
+#pragma message enable PTRMISMATCH
+#endif
+
ai = Curl_he2ai(h, port);
return ai;
}
-#endif
+#endif /* CURLRES_IPV4 || CURLRES_ARES */
diff --git a/lib/netrc.c b/lib/netrc.c
index da366fb6b..dc2e04294 100644
--- a/lib/netrc.c
+++ b/lib/netrc.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -227,7 +227,7 @@ int Curl_parsenetrc(char *host,
}
#ifdef _NETRC_DEBUG
-int main(int argc, char **argv)
+int main(int argc, argv_item_t argv[])
{
char login[64]="";
char password[64]="";
diff --git a/lib/setup_once.h b/lib/setup_once.h
index 4bbde0ec8..585faed8d 100644
--- a/lib/setup_once.h
+++ b/lib/setup_once.h
@@ -344,5 +344,26 @@ typedef int sig_atomic_t;
#endif
+/*
+ * Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid()
+ */
+
+#if defined(VMS) && \
+ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
+#define getpwuid __32_getpwuid
+#endif
+
+
+/*
+ * Macro argv_item_t hides platform details to code using it.
+ */
+
+#ifdef VMS
+#define argv_item_t __char_ptr32
+#else
+#define argv_item_t char *
+#endif
+
+
#endif /* __SETUP_ONCE_H */
diff --git a/lib/splay.c b/lib/splay.c
index 9fb66c76a..acfa373e2 100644
--- a/lib/splay.c
+++ b/lib/splay.c
@@ -21,6 +21,8 @@
* $Id$
***************************************************************************/
+#include "setup.h"
+
#include <stdio.h>
#include <stdlib.h>
@@ -364,7 +366,7 @@ void Curl_splayprint(struct Curl_tree * t, int d, char output)
/* A sample use of these functions. Start with the empty tree, insert some
stuff into it, and then delete it */
-int main(int argc, char **argv)
+int main(int argc, argv_item_t argv[])
{
struct Curl_tree *root, *t;
void *ptrs[MAX];
diff --git a/packages/vms/build_vms.com b/packages/vms/build_vms.com
index 5a97a3069..0c2cd0a7f 100755
--- a/packages/vms/build_vms.com
+++ b/packages/vms/build_vms.com
@@ -21,7 +21,9 @@ $!
$! Parameter(s):
$!
$! P1 - LISTING will create .lis files during the C compile
-$! DEBUG will compile and link with debug
+$! DEBUG will compile and link with debug; also will create
+$! compiler listings and linker map files
+$! 64 will compile and link with 64-bit pointers
$!
$! Revisions:
$!
@@ -44,6 +46,7 @@ $! USE_SSLEAY to define if the target has SSL support built
$! in. Changed the cc/define parameter accordingly.
$! 11-FEB-2005, MSK, If [--.LIB]AMIGAOS.C and NWLIB.C are there, rename them
$! 23-MAR-2005, MSK, relocated cc_qual define so that DEBUG option would work
+$! 25-APR-2007, STL, allow compilation in 64-bit mode.
$!
$ on control_y then goto Common_Exit
$ ctrl_y = 1556
@@ -75,25 +78,27 @@ $ set def 'thisdir'
$!
$ hpssl = 0
$ openssl = 0
-$ cc_qual = "/define=HAVE_CONFIG_H=1/OBJ=OBJDIR:"
+$ cc_qual = "/define=HAVE_CONFIG_H=1"
$ link_qual = ""
$ if f$trnlnm( "CURL_BUILD_NOSSL") .eqs. ""
$ then
$ if f$trnlnm( "OPENSSL") .nes. ""
$ then
$ openssl = 1
-$ cc_qual = "/define=(HAVE_CONFIG_H=1,USE_SSLEAY=1)/OBJ=OBJDIR:"
+$ cc_qual = "/define=(HAVE_CONFIG_H=1,USE_SSLEAY=1)"
$ if ( f$trnlnm( "SSL$INCLUDE") .nes. "") .and. -
( f$trnlnm( "CURL_BUILD_NOHPSSL") .eqs. "")
$ then hpssl = 1
$ endif
$ endif
$ endif
-$ if p1 .eqs. "LISTING" then cc_qual = cc_qual + "/LIST/MACHINE"
+$ cc_qual = cc_qual + "/OBJ=OBJDIR:"
+$ if p1 .eqs. "64" then cc_qual = cc_qual + "/POINTER=64"
+$ if p1 .eqs. "LISTING" then cc_qual = cc_qual + "/LIST/SHOW=ALL"
$ if p1 .eqs. "DEBUG"
$ then
-$ cc_qual = cc_qual + "/LIST/MACHINE/DEBUG/NOOPT"
-$ link_qual = "/DEBUG"
+$ cc_qual = cc_qual + "/LIST/SHOW=ALL/DEBUG/NOOPT"
+$ link_qual = "/DEBUG/MAP"
$ endif
$ msg_qual = "/OBJ=OBJDIR:"
$!
diff --git a/src/main.c b/src/main.c
index 229eb8dc8..ee2803537 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3482,7 +3482,7 @@ static void dumpeasycode(struct Configurable *config)
}
static int
-operate(struct Configurable *config, int argc, char *argv[])
+operate(struct Configurable *config, int argc, argv_item_t argv[])
{
char errorbuffer[CURL_ERROR_SIZE];
char useragent[128]; /* buah, we don't want a larger default user agent */