Advertisement
Anders

PuTTY 0.61 patch MSVC6+Platform2003 (with stdcall support)

Aug 16th, 2011
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.42 KB | None | 0 0
  1. --- WINDOWS/WINNET.C    Tue Jul 12 19:13:34 2011
  2. +++ WINDOWS/WINNET.C    Tue Aug 16 20:56:27 2011
  3. @@ -1695,8 +1695,8 @@
  4.      return hostname;
  5.  }
  6.  
  7. -SockAddr platform_get_x11_unix_address(const char *display, int displaynum,
  8. -                      char **canonicalname)
  9. +SockAddr platform_get_x11_unix_address(const char *display, int displaynum /*,
  10. +                      char **canonicalname*/)
  11.  {
  12.      SockAddr ret = snew(struct SockAddr_tag);
  13.      memset(ret, 0, sizeof(struct SockAddr_tag));
  14. --- WINDOWS/WINPGNTC.C  Wed Jun 08 21:47:08 2011
  15. +++ WINDOWS/WINPGNTC.C  Tue Aug 16 21:28:47 2011
  16. @@ -86,7 +86,7 @@
  17.               (PSECURITY_DESCRIPTOR, DWORD));
  18.  DECL_WINDOWS_FUNCTION(static, BOOL, SetSecurityDescriptorOwner,
  19.               (PSECURITY_DESCRIPTOR, PSID, BOOL));
  20. -DECL_WINDOWS_FUNCTION(, DWORD, GetSecurityInfo,
  21. +DECL_WINDOWS_FUNCTION(DECL_WINDOWS_FUNCTION_NOLINKAGE, DWORD, GetSecurityInfo,
  22.               (HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
  23.                PSID *, PSID *, PACL *, PACL *,
  24.                PSECURITY_DESCRIPTOR *));
  25. --- WINDOWS/WINPLINK.C  Mon Sep 14 22:26:48 2009
  26. +++ WINDOWS/WINPLINK.C  Tue Aug 16 22:05:13 2011
  27. @@ -273,7 +273,7 @@
  28.      }
  29.  }
  30.  
  31. -int main(int argc, char **argv)
  32. +int DECLSPEC_CDECL main(int argc, char *argv[])
  33.  {
  34.      int sending;
  35.      int portnumber = -1;
  36. @@ -628,7 +628,7 @@
  37.                       QS_POSTMESSAGE);
  38.     if ((unsigned)(n - WAIT_OBJECT_0) < (unsigned)nhandles) {
  39.         handle_got_event(handles[n - WAIT_OBJECT_0]);
  40. -   } else if (n == WAIT_OBJECT_0 + nhandles) {
  41. +   } else if ((unsigned)n == WAIT_OBJECT_0 + nhandles) {
  42.         WSANETWORKEVENTS things;
  43.         SOCKET socket;
  44.         extern SOCKET first_socket(int *), next_socket(int *);
  45. @@ -689,7 +689,7 @@
  46.                          }
  47.         }
  48.         }
  49. -   } else if (n == WAIT_OBJECT_0 + nhandles + 1) {
  50. +   } else if ((unsigned)n == WAIT_OBJECT_0 + nhandles + 1) {
  51.         MSG msg;
  52.         while (PeekMessage(&msg, INVALID_HANDLE_VALUE,
  53.                    WM_AGENT_CALLBACK, WM_AGENT_CALLBACK,
  54. --- WINDOWS/WINSFTP.C   Sun Sep 27 16:52:14 2009
  55. +++ WINDOWS/WINSFTP.C   Tue Aug 16 21:18:30 2011
  56. @@ -71,7 +71,7 @@
  57.  
  58.  #define TIME_POSIX_TO_WIN(t, ft) do { \
  59.      ULARGE_INTEGER uli; \
  60. -    uli.QuadPart = ((ULONGLONG)(t) + 11644473600ull) * 10000000ull; \
  61. +    uli.QuadPart = ((ULONGLONG)(t) + MK_UINT64(11644473600)) * MK_UINT64(10000000); \
  62.      (ft).dwLowDateTime  = uli.LowPart; \
  63.      (ft).dwHighDateTime = uli.HighPart; \
  64.  } while(0)
  65. @@ -79,7 +79,7 @@
  66.      ULARGE_INTEGER uli; \
  67.      uli.LowPart  = (ft).dwLowDateTime; \
  68.      uli.HighPart = (ft).dwHighDateTime; \
  69. -    uli.QuadPart = uli.QuadPart / 10000000ull - 11644473600ull; \
  70. +    uli.QuadPart = uli.QuadPart / MK_UINT64(10000000) - MK_UINT64(11644473600); \
  71.      (t) = (unsigned long) uli.QuadPart; \
  72.  } while(0)
  73.  
  74. --- WINDOWS/WINSTUFF.H  Wed Jun 08 21:47:08 2011
  75. +++ WINDOWS/WINSTUFF.H  Tue Aug 16 21:45:30 2011
  76. @@ -15,6 +15,14 @@
  77.  
  78.  #include "winhelp.h"
  79.  
  80. +#ifdef _MSC_VER
  81. +#define DECLSPEC_CDECL __cdecl
  82. +#endif
  83. +#ifdef __GNUC_PATCHLEVEL__
  84. +#define DECLSPEC_CDECL __attribute__((cdecl))
  85. +#endif
  86. +
  87. +
  88.  struct Filename {
  89.      char path[FILENAME_MAX];
  90.  };
  91. @@ -99,6 +107,8 @@
  92.      (p_##name = module ? (t_##name) GetProcAddress(module, STR(name)) : NULL)
  93.  #define GET_WINDOWS_FUNCTION(module, name) \
  94.      (p_##name = module ? (t_##name) GetProcAddress(module, #name) : NULL)
  95. +
  96. +#define DECL_WINDOWS_FUNCTION_NOLINKAGE /* MSVC6 cannot handle empty macro parameter */
  97.  
  98.  /*
  99.   * Global variables. Most modules declare these `extern', but
  100. --- CONFIG.C    Fri Jan 14 19:57:00 2011
  101. +++ CONFIG.C    Tue Aug 16 21:53:27 2011
  102. @@ -812,7 +812,7 @@
  103.         left = lenof(cfg->ttymodes);
  104.         while (*p) {
  105.             int t = strchr(p, '\t') - p;
  106. -           if (t == strlen(ttymodes[ind]) &&
  107. +           if (t == (int)strlen(ttymodes[ind]) &&
  108.             strncmp(p, ttymodes[ind], t) == 0) {
  109.             memmove(p, p+strlen(p)+1, left - (strlen(p)+1));
  110.             continue;
  111. @@ -842,7 +842,7 @@
  112.                 int ind = 0;
  113.                 val++;
  114.                 while (ttymodes[ind]) {
  115. -               if (strlen(ttymodes[ind]) == val-p-1 &&
  116. +               if ((signed)strlen(ttymodes[ind]) == val-p-1 &&
  117.                     !strncmp(ttymodes[ind], p, val-p-1))
  118.                     break;
  119.                 ind++;
  120. --- MISC.H  Sun Apr 23 19:26:04 2006
  121. +++ MISC.H  Tue Aug 16 21:17:39 2011
  122. @@ -129,4 +129,21 @@
  123.    (cp)[0] = (unsigned char)((value) >> 8), \
  124.    (cp)[1] = (unsigned char)(value) )
  125.  
  126. +
  127. +
  128. +/*
  129. + * Trick compilers without ULL suffix support
  130. + */
  131. +#ifdef _MSC_VER
  132. +#if (_MSC_VER <= 1200) /* VC6, but what about 2003 and 2005? */
  133. +#define MK_UINT64(n) MK_UINT64_MSVCINLINE((n))
  134. +__forceinline unsigned __int64 MK_UINT64_MSVCINLINE(unsigned __int64 n)
  135. +  {return n;}
  136. +#endif
  137. +#endif
  138. +#ifndef MK_UINT64
  139. +#define MK_UINT64(n) (n##ULL)
  140. +#endif
  141. +
  142. +
  143.  #endif
  144. --- PSCP.C  Fri Aug 07 01:19:04 2009
  145. +++ PSCP.C  Tue Aug 16 21:48:16 2011
  146. @@ -647,7 +647,7 @@
  147.  /* ----------------------------------------------------------------------
  148.   * sftp-based replacement for the hacky `pscp -ls'.
  149.   */
  150. -static int sftp_ls_compare(const void *av, const void *bv)
  151. +static int DECLSPEC_CDECL sftp_ls_compare(const void *av, const void *bv)
  152.  {
  153.      const struct fxp_name *a = (const struct fxp_name *) av;
  154.      const struct fxp_name *b = (const struct fxp_name *) bv;
  155. --- PSFTP.C Tue Mar 01 23:04:38 2011
  156. +++ PSFTP.C Tue Aug 16 21:49:01 2011
  157. @@ -178,7 +178,7 @@
  158.   * qsort comparison routine for fxp_name structures. Sorts by real
  159.   * file name.
  160.   */
  161. -static int sftp_name_compare(const void *av, const void *bv)
  162. +static int DECLSPEC_CDECL sftp_name_compare(const void *av, const void *bv)
  163.  {
  164.      const struct fxp_name *const *a = (const struct fxp_name *const *) av;
  165.      const struct fxp_name *const *b = (const struct fxp_name *const *) bv;
  166. @@ -188,7 +188,7 @@
  167.  /*
  168.   * Likewise, but for a bare char *.
  169.   */
  170. -static int bare_name_compare(const void *av, const void *bv)
  171. +static int DECLSPEC_CDECL bare_name_compare(const void *av, const void *bv)
  172.  {
  173.      const char **a = (const char **) av;
  174.      const char **b = (const char **) bv;
  175. --- PUTTYPS.H   Sat Sep 25 09:37:30 2010
  176. +++ PUTTYPS.H   Tue Aug 16 21:37:42 2011
  177. @@ -19,4 +19,8 @@
  178.  
  179.  #endif
  180.  
  181. +#ifndef DECLSPEC_CDECL
  182. +#define DECLSPEC_CDECL
  183. +#endif
  184. +
  185.  #endif
  186. --- SETTINGS.C  Sat Jun 25 18:37:32 2011
  187. +++ SETTINGS.C  Tue Aug 16 21:46:35 2011
  188. @@ -918,7 +918,7 @@
  189.      load_settings(session, cfg);
  190.  }
  191.  
  192. -static int sessioncmp(const void *av, const void *bv)
  193. +static int DECLSPEC_CDECL sessioncmp(const void *av, const void *bv)
  194.  {
  195.      const char *a = *(const char *const *) av;
  196.      const char *b = *(const char *const *) bv;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement