patches to compile on win32 for vc

5468696A6D656E thijmen at xs4all.nl
Wed Feb 4 13:08:45 CET 2004


Additional to my bugreport only a really small number
of changes is needed to get gpg to compile with Visual C 6.0 and later.

I think the sources recently have improved portability a lot.
(maybe because of the changes of __MINGW32__ to _WIN32 )

These are the patches for the files:
util/dotlock.c
util/simple-gettext.c
g10/misc.c
g10/plaintext.c
include/types.h

That's it, only 5, and minor changes :) If anyone on this list would
like the project files don't hesitate to ask.

Additionally i have added a batch file called mpi/BuildAsm.bat for
compiling the assembly mpi files.

I hope this helps to bring encryption to the masses :)

-------------- next part --------------
*** include/types-orig.h	Fri Oct  3 14:50:30 2003
--- include/types.h	Tue Feb  3 14:31:51 2004
***************
*** 114,121 ****
--- 114,126 ----
  #define U64_C(c) (c ## UL)
  #define HAVE_U64_TYPEDEF
  #elif SIZEOF_UNSIGNED_LONG_LONG == 8
+ #if (defined(_MSC_VER) && _MSC_VER < 1400)
+ typedef unsigned __int64 u64;
+ #define U64_C(c) (u64)c
+ #else
  typedef unsigned long long u64;
  #define U64_C(c) (c ## ULL)
+ #endif
  #define HAVE_U64_TYPEDEF
  #endif
  #endif
-------------- next part --------------
*** g10/plaintext-orig.c	Sat Jun  7 20:55:20 2003
--- g10/plaintext.c	Tue Feb  3 14:18:22 2004
***************
*** 25,31 ****
  #include <errno.h>
  #include <assert.h>
  #ifdef HAVE_DOSISH_SYSTEM
! #include <fcntl.h> /* for setmode() */
  #endif
  
  #include "util.h"
--- 25,34 ----
  #include <errno.h>
  #include <assert.h>
  #ifdef HAVE_DOSISH_SYSTEM
! #include <fcntl.h> /* for setmode() && O_BINARY */
! #ifdef _MSC_VER
! #include <io.h> /* for setmode() */
! #endif
  #endif
  
  #include "util.h"
-------------- next part --------------
*** g10/misc-orig.c	Wed Dec  3 11:10:16 2003
--- g10/misc.c	Tue Feb  3 13:47:25 2004
***************
*** 28,35 ****
  #include <asm/sysinfo.h>
  #include <asm/unistd.h>
  #endif
- #ifdef HAVE_SETRLIMIT
  #include <time.h>
  #include <sys/time.h>
  #include <sys/resource.h>
  #endif
--- 28,35 ----
  #include <asm/sysinfo.h>
  #include <asm/unistd.h>
  #endif
  #include <time.h>
+ #ifdef HAVE_SETRLIMIT
  #include <sys/time.h>
  #include <sys/resource.h>
  #endif
-------------- next part --------------
*** util/dotlock-orig.c	Wed Jul 30 17:36:00 2003
--- util/dotlock.c	Tue Feb  3 13:51:22 2004
***************
*** 81,93 ****
      static int initialized;
      DOTLOCK h;
      int  fd = -1;
-     char pidstr[16];
  #if !defined (HAVE_DOSISH_SYSTEM)
      struct utsname utsbuf;
- #endif
      const char *nodename;
      const char *dirpart;
      int dirpartlen;
  
      if( !initialized ) {
  	atexit( remove_lockfiles );
--- 81,93 ----
      static int initialized;
      DOTLOCK h;
      int  fd = -1;
  #if !defined (HAVE_DOSISH_SYSTEM)
+     char pidstr[16];
      struct utsname utsbuf;
      const char *nodename;
      const char *dirpart;
      int dirpartlen;
+ #endif
  
      if( !initialized ) {
  	atexit( remove_lockfiles );
-------------- next part --------------
*** util/simple-gettext-orig.c	Wed Jul 30 17:42:36 2003
--- util/simple-gettext.c	Tue Feb  3 13:54:58 2004
***************
*** 95,101 ****
--- 95,105 ----
  
  static struct loaded_domain *the_domain;
  
+ #ifdef _MSC_VER
+ static u32
+ #else
  static __inline__ u32
+ #endif
  do_swap_u32( u32 i )
  {
    return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
***************
*** 111,117 ****
--- 115,125 ----
     [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
     1986, 1987 Bell Telephone Laboratories, Inc.]  */
  
+ #ifdef _MSC_VER
+ static ulong
+ #else
  static __inline__ ulong
+ #endif
  hash_string( const char *str_param )
  {
      unsigned long int hval, g;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BuildAsm.bat
Type: application/x-msdos-program
Size: 2397 bytes
Desc: not available
Url : /pipermail/attachments/20040204/e3b3c8f0/BuildAsm.bin


More information about the Gnupg-devel mailing list