diff options
author | johnvg | 2006-01-05 13:01:00 +0000 |
---|---|---|
committer | johnvg | 2006-01-05 13:01:00 +0000 |
commit | e6558f42505a92d20ff7fed18388e79d1cfc8d73 (patch) | |
tree | a2250e5dfc681e88801ce41bcd066e0aaed9ef19 | |
parent | add function BEGetIntFromArray, will replace BECopyInts because copying (diff) |
port to 64 bit windows
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1584 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r-- | backendC/CleanCompilerSources/backendsupport.h | 2 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/buildtree.c | 9 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/codegen2.c | 4 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/sa.c | 2 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/types.t | 20 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/version.c | 4 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/windows_io.c | 13 |
7 files changed, 41 insertions, 13 deletions
diff --git a/backendC/CleanCompilerSources/backendsupport.h b/backendC/CleanCompilerSources/backendsupport.h index ee127a0..d1cbe38 100644 --- a/backendC/CleanCompilerSources/backendsupport.h +++ b/backendC/CleanCompilerSources/backendsupport.h @@ -2,7 +2,7 @@ Clean string ============ */ -typedef struct clean_string {int length; char chars [1]; } *CleanString; +typedef struct clean_string {size_t length; char chars [1]; } *CleanString; /* Debugging diff --git a/backendC/CleanCompilerSources/buildtree.c b/backendC/CleanCompilerSources/buildtree.c index 73133c8..e53d197 100644 --- a/backendC/CleanCompilerSources/buildtree.c +++ b/backendC/CleanCompilerSources/buildtree.c @@ -526,9 +526,18 @@ void clear_p_at_node_tree (void) static NodeP reorder_bits (NodeP node) { +#ifdef _WIN64 + unsigned __int64 n,m; + + n=(unsigned __int64)node; + + m=n & 0x000ffffffff; + n= (m<<32) | ((n^m)>>32); +#else unsigned long n,m; n=(long)node; +#endif m=n & 0x000ffffL; n= (m<<16) | ((n^m)>>16); diff --git a/backendC/CleanCompilerSources/codegen2.c b/backendC/CleanCompilerSources/codegen2.c index a609011..82c1d2d 100644 --- a/backendC/CleanCompilerSources/codegen2.c +++ b/backendC/CleanCompilerSources/codegen2.c @@ -6441,7 +6441,11 @@ void InitCoding (void) InitBasicDescriptor (BoolObj, "BOOL", SizeOfBool); InitBasicDescriptor (CharObj, "CHAR", SizeOfChar); InitBasicDescriptor (StringObj, "STRING", SizeOfAStackElem); +#ifdef G_A64 + InitBasicDescriptor (RealObj, "REAL", 1); +#else InitBasicDescriptor (RealObj, "REAL", SizeOfReal); +#endif InitBasicDescriptor (FileObj, "FILE", SizeOfFile); InitBasicDescriptor (ArrayObj, "ARRAY", SizeOfAStackElem); InitBasicDescriptor (UnboxedArrayObj, "ARRAY", SizeOfAStackElem); diff --git a/backendC/CleanCompilerSources/sa.c b/backendC/CleanCompilerSources/sa.c index be6ba8c..d71a500 100644 --- a/backendC/CleanCompilerSources/sa.c +++ b/backendC/CleanCompilerSources/sa.c @@ -344,7 +344,7 @@ static unsigned MemUse (void) if (! free_pos) l = (long) (usedblocks-1) * BLOCK_SIZE; else - l = (long) (usedblocks-1) * BLOCK_SIZE + ((long) free_pos - (long) SA_store[usedblocks-1]); + l = (long) (usedblocks-1) * BLOCK_SIZE + (long) ((size_t) free_pos - (size_t) SA_store[usedblocks-1]); return (unsigned) ((l-1) / KBYTE) + 1; } diff --git a/backendC/CleanCompilerSources/types.t b/backendC/CleanCompilerSources/types.t index 909c22a..673436d 100644 --- a/backendC/CleanCompilerSources/types.t +++ b/backendC/CleanCompilerSources/types.t @@ -47,17 +47,23 @@ typedef unsigned long SysTime; #ifdef _WINDOWS_ # include <stdarg.h> -# define FileTime FILETIME -# ifdef __MWERKS__ -# include <x86_prefix.h> +# ifdef _WIN64 +# undef _WINDOWS_ +# include <windows.h> +# define FileTime struct _FILETIME # else -# define _X86_ +# ifdef __MWERKS__ +# include <x86_prefix.h> +# else +# define _X86_ +# endif +# include <windef.h> +# include <winbase.h> +# define FileTime FILETIME # endif -# include <windef.h> -# include <winbase.h> #else # if defined (POWER) && defined (KARBON) -#include <UTCUtils.h> +# include <UTCUtils.h> typedef UTCDateTime FileTime; # else typedef unsigned long FileTime; diff --git a/backendC/CleanCompilerSources/version.c b/backendC/CleanCompilerSources/version.c index b74fb35..6ba358c 100644 --- a/backendC/CleanCompilerSources/version.c +++ b/backendC/CleanCompilerSources/version.c @@ -1,3 +1,7 @@ #include "version.h" +#ifdef _WIN64 +int VERSION=919; +#else int VERSION=920; +#endif diff --git a/backendC/CleanCompilerSources/windows_io.c b/backendC/CleanCompilerSources/windows_io.c index 986d95e..8b5014d 100644 --- a/backendC/CleanCompilerSources/windows_io.c +++ b/backendC/CleanCompilerSources/windows_io.c @@ -7,13 +7,18 @@ #include "system.h" #include <stdio.h> -#ifdef __MWERKS__ -# include <x86_prefix.h> +#ifdef _WIN64 +# undef _WINDOWS_ +# include <windows.h> #else +# ifdef __MWERKS__ +# include <x86_prefix.h> +# else # define _X86_ +# endif +# include <windef.h> +# include <winbase.h> #endif -#include <windef.h> -#include <winbase.h> char *GetFileExtension (FileKind kind) { |