Browse Source

Merged revisions 6803,7041,7048,7052-7053,7059,7065-7066,7070-7071,7073 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

r6803 (florian)
* load moveproc with default value


r7041 (florian)
* made arm-wince default target for arm cross compilers hosted on windows


r7048 (florian)
* fixed test, doing findclose twice hurts at least win64


r7052 (florian)
* made RT_* simple constants, fixes #8584


r7053 (florian)
* fixed profiler startup code to link again, resolves #8551


r7059 (florian)
* don't take size of open array defs, resolves #8615


r7065 (florian)
* don't crash on invalid property declarations, resolves #8451


r7066 (florian)
* moved


r7070 (florian)
* fixed ipc syscalls and data structures for x86-64, resolves #8616


r7071 (florian)
* fixed several type declarations

r7073 (florian)
* fixed ipc for 32 bit systems

git-svn-id: branches/fixes_2_2@7087 -

florian 18 years ago
parent
commit
bd8fe9a2e9

+ 7 - 1
compiler/pdecvar.pas

@@ -104,6 +104,7 @@ implementation
                     else
                     else
                       begin
                       begin
                         Message1(parser_e_illegal_field_or_method,orgpattern);
                         Message1(parser_e_illegal_field_or_method,orgpattern);
+                        def:=generrordef;
                         result:=false;
                         result:=false;
                       end;
                       end;
                   end;
                   end;
@@ -111,6 +112,7 @@ implementation
                else
                else
                 begin
                 begin
                   Message1(parser_e_illegal_field_or_method,orgpattern);
                   Message1(parser_e_illegal_field_or_method,orgpattern);
+                  def:=generrordef;
                   result:=false;
                   result:=false;
                 end;
                 end;
                consume(_ID);
                consume(_ID);
@@ -814,13 +816,17 @@ implementation
                   abssym.fileinfo:=vs.fileinfo;
                   abssym.fileinfo:=vs.fileinfo;
                   abssym.abstyp:=tovar;
                   abssym.abstyp:=tovar;
                   abssym.ref:=node_to_propaccesslist(pt);
                   abssym.ref:=node_to_propaccesslist(pt);
+
                   { if the sizes are different, can't be a regvar since you }
                   { if the sizes are different, can't be a regvar since you }
                   { can't be "absolute upper 8 bits of a register" (except  }
                   { can't be "absolute upper 8 bits of a register" (except  }
                   { if its a record field of the same size of a record      }
                   { if its a record field of the same size of a record      }
                   { regvar, but in that case pt.resultdef.size will have    }
                   { regvar, but in that case pt.resultdef.size will have    }
                   { the same size since it refers to the field and not to   }
                   { the same size since it refers to the field and not to   }
                   { the whole record -- which is why we use pt and not hp)  }
                   { the whole record -- which is why we use pt and not hp)  }
-                  if (vs.vardef.size <> pt.resultdef.size) then
+
+                  { we can't take the size of an open array }
+                  if is_open_array(pt.resultdef) or
+                     (vs.vardef.size <> pt.resultdef.size) then
                     make_not_regable(pt,vr_addr);
                     make_not_regable(pt,vr_addr);
                 end
                 end
               else
               else

+ 3 - 2
rtl/arm/arm.inc

@@ -20,8 +20,6 @@
 const
 const
   cpu_has_edsp : boolean = false;
   cpu_has_edsp : boolean = false;
   in_edsp_test : boolean = false;
   in_edsp_test : boolean = false;
-var
-  moveproc : pointer;
 
 
 procedure fpc_cpuinit;
 procedure fpc_cpuinit;
 begin
 begin
@@ -278,6 +276,9 @@ asm
 end;
 end;
 
 
 
 
+const
+  moveproc : pointer = @move_blended;
+
 procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];assembler;nostackframe;
 procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];assembler;nostackframe;
 asm
 asm
   ldr ip,.Lmoveproc
   ldr ip,.Lmoveproc

+ 0 - 1
rtl/linux/i386/si_c21.inc

@@ -36,7 +36,6 @@
 var
 var
   libc21_fpc_ret, libc21_fpc_ret_ebx, libc21_fpc_ret_ebp: ptrint; { return address to libc }
   libc21_fpc_ret, libc21_fpc_ret_ebx, libc21_fpc_ret_ebp: ptrint; { return address to libc }
 
 
-procedure libc_atexit; external name '__libc_atexit';
 procedure libc_exit; external name '__libc_exit';
 procedure libc_exit; external name '__libc_exit';
 procedure libc_init; external name '__libc_init';
 procedure libc_init; external name '__libc_init';
 procedure libc_setfpucw; external name '__setfpucw';
 procedure libc_setfpucw; external name '__setfpucw';

+ 1 - 1
rtl/linux/i386/si_c21g.inc

@@ -43,7 +43,7 @@ var
 
 
 procedure gmon_monstartup; external name 'monstartup';
 procedure gmon_monstartup; external name 'monstartup';
 
 
-procedure libc_atexit; external name '__libc_atexit';
+procedure libc_atexit; external name 'atexit';
 procedure libc_exit; external name '__libc_exit';
 procedure libc_exit; external name '__libc_exit';
 procedure libc_init; external name '__libc_init';
 procedure libc_init; external name '__libc_init';
 procedure libc_setfpucw; external name '__setfpucw';
 procedure libc_setfpucw; external name '__setfpucw';

+ 7 - 7
rtl/linux/ipcsys.inc

@@ -28,7 +28,7 @@ end;
 
 
 function shmget(key: Tkey; size:cint; flag:cint):cint;
 function shmget(key: Tkey; size:cint; flag:cint):cint;
 begin
 begin
-  shmget:=do_syscall (syscall_nr_SHMGET,TSysParam(key),TSysParam(size),TSysParam(flag),TSysParam(0));
+  shmget:=do_syscall (syscall_nr_SHMGET,TSysParam(key),TSysParam(size),TSysParam(flag));
 end;
 end;
 
 
 function shmat (shmid:cint; shmaddr:pointer; shmflg:cint): pointer;
 function shmat (shmid:cint; shmaddr:pointer; shmflg:cint): pointer;
@@ -38,17 +38,17 @@ end;
 
 
 function shmdt (shmaddr:pointer): cint;
 function shmdt (shmaddr:pointer): cint;
 begin
 begin
-  shmdt:=do_syscall(syscall_nr_SHMDT,TSysParam(0),TSysParam(0),TSysParam(0),TSysParam(shmaddr));
+  shmdt:=do_syscall(syscall_nr_SHMDT,TSysParam(shmaddr));
 end;
 end;
 
 
 function shmctl(shmid:cint; cmd:cint; buf: pshmid_ds): cint;
 function shmctl(shmid:cint; cmd:cint; buf: pshmid_ds): cint;
 begin
 begin
- shmctl:=do_syscall(syscall_nr_SHMCTL,TSysParam(shmid),TSysParam(cmd),TSysParam(0),TSysParam(buf));
+ shmctl:=do_syscall(syscall_nr_SHMCTL,TSysParam(shmid),TSysParam(cmd),TSysParam(buf));
 end;
 end;
 
 
 function msgget(key:Tkey; msgflg:cint):cint;
 function msgget(key:Tkey; msgflg:cint):cint;
 begin
 begin
-  msgget:=do_syscall(syscall_nr_MSGGET,TSysParam(key),TSysParam(msgflg),TSysParam(0),TSysParam(0));
+  msgget:=do_syscall(syscall_nr_MSGGET,TSysParam(key),TSysParam(msgflg));
 end;
 end;
 
 
 function msgsnd(msqid:cint; msgp: pmsgbuf; msgsz: size_t; msgflg:cint):cint;
 function msgsnd(msqid:cint; msgp: pmsgbuf; msgsz: size_t; msgflg:cint):cint;
@@ -72,17 +72,17 @@ end;
 
 
 Function msgctl(msqid:cint; cmd: cint; buf: PMSQid_ds): cint;
 Function msgctl(msqid:cint; cmd: cint; buf: PMSQid_ds): cint;
 begin
 begin
-  msgctl:=do_syscall(syscall_nr_MSGCTL,TSysParam(msqid),TSysParam(cmd),TSysParam(0),TSysParam(buf));
+  msgctl:=do_syscall(syscall_nr_MSGCTL,TSysParam(msqid),TSysParam(cmd),TSysParam(buf));
 end;
 end;
 
 
 Function semget(key:Tkey; nsems:cint; semflg:cint): cint;
 Function semget(key:Tkey; nsems:cint; semflg:cint): cint;
 begin
 begin
-  semget:=do_syscall (syscall_nr_SEMGET,TSysParam(key),TSysParam(nsems),TSysParam(semflg),TSysParam(0));
+  semget:=do_syscall (syscall_nr_SEMGET,TSysParam(key),TSysParam(nsems),TSysParam(semflg));
 end;
 end;
 
 
 Function semop(semid:cint; sops: psembuf; nsops:cuint): cint;
 Function semop(semid:cint; sops: psembuf; nsops:cuint): cint;
 begin
 begin
-  semop:=do_syscall (syscall_nr_SEMOP,TSysParam(semid),TSysParam(nsops),TSysParam(0),TSysParam(sops));
+  semop:=do_syscall (syscall_nr_SEMOP,TSysParam(semid),TSysParam(sops),TSysParam(nsops));
 end;
 end;
 
 
 Function semctl(semid:cint; semnum:cint; cmd:cint; var arg: tsemun): cint;
 Function semctl(semid:cint; semnum:cint; cmd:cint; var arg: tsemun): cint;

+ 18 - 7
rtl/linux/ptypes.inc

@@ -47,10 +47,6 @@ Type
     TkDev    = KDev_t;          // kernel and glibc. This is kernel.
     TkDev    = KDev_t;          // kernel and glibc. This is kernel.
     pkDev    = ^kdev_t;
     pkDev    = ^kdev_t;
 
 
-    gid_t    = cuint32;         { used for group IDs           }
-    TGid     = gid_t;
-    pGid     = ^gid_t;
-
     ino_t    = clong;           { used for file serial numbers }
     ino_t    = clong;           { used for file serial numbers }
     TIno     = ino_t;
     TIno     = ino_t;
     pIno     = ^ino_t;
     pIno     = ^ino_t;
@@ -59,7 +55,11 @@ Type
     TIno64   = ino64_t;
     TIno64   = ino64_t;
     pIno64   = ^ino64_t;
     pIno64   = ^ino64_t;
 
 
-    mode_t   = cuint32;         { used for file attributes     }
+{$ifdef cpu64}
+    mode_t   = cint;         { used for file attributes     }
+{$else cpu64}
+    mode_t   = cushort;      { used for file attributes     }
+{$endif cpu64}
     TMode    = mode_t;
     TMode    = mode_t;
     pMode    = ^mode_t;
     pMode    = ^mode_t;
 
 
@@ -75,7 +75,7 @@ Type
     TOff     = off_t;
     TOff     = off_t;
     pOff     = ^off_t;
     pOff     = ^off_t;
 
 
-    pid_t    = cint32;          { used as process identifier   }
+    pid_t    = cint;          { used as process identifier   }
     TPid     = pid_t;
     TPid     = pid_t;
     pPid     = ^pid_t;
     pPid     = ^pid_t;
 
 
@@ -105,9 +105,20 @@ Type
     wchar_t   = widechar;
     wchar_t   = widechar;
     pwchar_t  = ^wchar_t;
     pwchar_t  = ^wchar_t;
 
 
-    uid_t    = cuint32;         { used for user ID type        }
+{$ifdef cpu64}
+    uid_t    = cuint;         { used for user ID type        }
+    gid_t    = cuint;         { used for group IDs           }
+    ipc_pid_t = cint;
+{$else cpu64}
+    uid_t    = cushort;         { used for user ID type        }
+    gid_t    = cushort;         { used for group IDs           }
+    ipc_pid_t = cushort;
+{$endif cpu64}
     TUid     = uid_t;
     TUid     = uid_t;
     pUid     = ^uid_t;
     pUid     = ^uid_t;
+    TGid     = gid_t;
+    pGid     = ^gid_t;
+
 
 
     socklen_t= cuint32;
     socklen_t= cuint32;
     TSockLen = socklen_t;
     TSockLen = socklen_t;

+ 76 - 42
rtl/unix/ipc.pp

@@ -13,11 +13,16 @@
 
 
  **********************************************************************}
  **********************************************************************}
 
 
+{$ifdef linux}
+{$ifdef FPC_USE_LIBC}
+  {$fatal This unit must be completely overhauled for use with libc on linux}
+{$endif}
+{$endif linux}
 Unit ipc;
 Unit ipc;
 
 
 interface
 interface
 
 
-Uses BaseUnix;
+Uses BaseUnix,UnixType;
 
 
 { ----------------------------------------------------------------------
 { ----------------------------------------------------------------------
   General IPC stuff
   General IPC stuff
@@ -31,7 +36,7 @@ Type
    {$IFDEF FreeBSD}
    {$IFDEF FreeBSD}
    TKey   = clong;
    TKey   = clong;
    {$ELSE}
    {$ELSE}
-   TKey   = longint;
+   TKey   = cint;
    {$ENDIF}
    {$ENDIF}
    key_t  = TKey;
    key_t  = TKey;
 
 
@@ -49,9 +54,9 @@ Const
   IPC_EXCL   =  2 shl 9;  { fail if key exists }
   IPC_EXCL   =  2 shl 9;  { fail if key exists }
   IPC_NOWAIT =  4 shl 9;  { return error on wait }
   IPC_NOWAIT =  4 shl 9;  { return error on wait }
 
 
-  {$IF DEFINED(FreeBSD) or DEFINED(Linux)}
+{$if defined(FreeBSD) or defined(Linux)}
   IPC_PRIVATE : TKey = 0;
   IPC_PRIVATE : TKey = 0;
-  {$ENDIF}
+{$endif}
 
 
   { Actions for ctl calls }
   { Actions for ctl calls }
 
 
@@ -62,7 +67,7 @@ Const
 
 
 type
 type
   PIPC_Perm = ^TIPC_Perm;
   PIPC_Perm = ^TIPC_Perm;
-  {$ifdef FreeBSD}
+{$ifdef FreeBSD}
   TIPC_Perm = record
   TIPC_Perm = record
         cuid  : cushort;  { creator user id }
         cuid  : cushort;  { creator user id }
         cgid  : cushort;  { creator group id }
         cgid  : cushort;  { creator group id }
@@ -71,18 +76,34 @@ type
         mode  : cushort;  { r/w permission }
         mode  : cushort;  { r/w permission }
         seq   : cushort;  { sequence # (to generate unique msg/sem/shm id) }
         seq   : cushort;  { sequence # (to generate unique msg/sem/shm id) }
         key   : key_t;    { user specified msg/sem/shm key }
         key   : key_t;    { user specified msg/sem/shm key }
-        End;
-  {$else} // linux
+  End;
+{$else} // linux
+{$ifdef cpux86_64}
   TIPC_Perm = record
   TIPC_Perm = record
         key   : TKey;
         key   : TKey;
-        uid,
-        gid,
-        cuid,
-        cgid,
-        mode,
-        seq   : Word;
-        End;
-  {$endif}
+        uid   : uid_t;
+        gid   : gid_t;
+        cuid  : uid_t;
+        cgid  : gid_t;
+        mode  : mode_t;
+        __pad1    : cushort;
+        seq       : cushort;
+        __pad2    : cushort;
+        __unused1 : culong;
+        __unused2 : culong;
+  End;
+{$else cpux86_64}  
+  TIPC_Perm = record
+        key   : TKey;
+        uid   : uid_t;
+        gid   : gid_t;
+        cuid  : uid_t;
+        cgid  : gid_t;
+        mode  : mode_t;
+        seq   : cushort;
+  End;
+{$endif cpux86_64}
+{$endif}
 
 
 { Function to generate a IPC key. }
 { Function to generate a IPC key. }
 Function ftok (Path : pchar;  ID : cint) : TKey;
 Function ftok (Path : pchar;  ID : cint) : TKey;
@@ -94,19 +115,34 @@ Function ftok (Path : pchar;  ID : cint) : TKey;
 Type
 Type
   PShmid_DS = ^TShmid_ds;
   PShmid_DS = ^TShmid_ds;
 {$ifdef linux}
 {$ifdef linux}
+{$ifdef cpux86_64}
   TShmid_ds = record
   TShmid_ds = record
     shm_perm  : TIPC_Perm;
     shm_perm  : TIPC_Perm;
-    shm_segsz : longint;
-    shm_atime : longint;
-    shm_dtime : longint;
-    shm_ctime : longint;
-    shm_cpid  : word;
-    shm_lpid  : word;
-    shm_nattch : integer;
+    shm_segsz : size_t;
+    shm_atime : time_t;
+    shm_dtime : time_t;
+    shm_ctime : time_t;
+    shm_cpid  : pid_t;
+    shm_lpid  : pid_t;
+    shm_nattch : culong;
+    __unused4 : culong;
+    __unused5 : culong;
+  end;
+{$else cpux86_64}  
+  TShmid_ds = record
+    shm_perm  : TIPC_Perm;
+    shm_segsz : cint;
+    shm_atime : time_t;
+    shm_dtime : time_t;
+    shm_ctime : time_t;
+    shm_cpid  : ipc_pid_t;
+    shm_lpid  : ipc_pid_t;
+    shm_nattch : word;
     shm_npages : word;
     shm_npages : word;
     shm_pages  : Pointer;
     shm_pages  : Pointer;
     attaches   : pointer;
     attaches   : pointer;
   end;
   end;
+{$endif cpux86_64}  
 {$else} // FreeBSD checked
 {$else} // FreeBSD checked
   TShmid_ds = record
   TShmid_ds = record
     shm_perm  : TIPC_Perm;
     shm_perm  : TIPC_Perm;
@@ -155,7 +191,7 @@ type            // the shm*info kind is "kernel" only.
     shmall : cint;
     shmall : cint;
   end;
   end;
 
 
-{$ifdef FreeBSD}
+{$if defined(freebsd) or defined(linux)}
   PSHM_info = ^TSHM_info;
   PSHM_info = ^TSHM_info;
   TSHM_info = record
   TSHM_info = record
     used_ids : cint;
     used_ids : cint;
@@ -210,16 +246,14 @@ type
     msg_perm   : TIPC_perm;
     msg_perm   : TIPC_perm;
     msg_first  : PMsg;
     msg_first  : PMsg;
     msg_last   : PMsg;
     msg_last   : PMsg;
-    msg_stime  : Longint;
-    msg_rtime  : Longint;
-    msg_ctime  : Longint;
-    wwait      : Pointer;
-    rwait      : pointer;
+    msg_stime  : time_t;
+    msg_rtime  : time_t;
+    msg_ctime  : time_t;
     msg_cbytes : word;
     msg_cbytes : word;
     msg_qnum   : word;
     msg_qnum   : word;
     msg_qbytes : word;
     msg_qbytes : word;
-    msg_lspid  : word;
-    msg_lrpid  : word;
+    msg_lspid  : ipc_pid_t;
+    msg_lrpid  : ipc_pid_t;
   end;
   end;
 {$else}
 {$else}
   PMSQid_ds = ^TMSQid_ds;
   PMSQid_ds = ^TMSQid_ds;
@@ -244,21 +278,21 @@ type
 
 
   PMSGbuf = ^TMSGbuf;
   PMSGbuf = ^TMSGbuf;
   TMSGbuf = record              // called mymsg on freebsd and SVID manual
   TMSGbuf = record              // called mymsg on freebsd and SVID manual
-    mtype : longint;
+    mtype : clong;
     mtext : array[0..0] of char;
     mtext : array[0..0] of char;
   end;
   end;
 
 
 {$ifdef linux}
 {$ifdef linux}
   PMSGinfo = ^TMSGinfo;
   PMSGinfo = ^TMSGinfo;
   TMSGinfo = record
   TMSGinfo = record
-    msgpool : Longint;
-    msgmap  : Longint;
-    msgmax  : Longint;
-    msgmnb  : Longint;
-    msgmni  : Longint;
-    msgssz  : Longint;
-    msgtql  : Longint;
-    msgseg  : Word;
+    msgpool : cint;
+    msgmap  : cint;
+    msgmax  : cint;
+    msgmnb  : cint;
+    msgmni  : cint;
+    msgssz  : cint;
+    msgtql  : cint;
+    msgseg  : cushort;
   end;
   end;
 {$else}
 {$else}
   PMSGinfo = ^TMSGinfo;
   PMSGinfo = ^TMSGinfo;
@@ -320,13 +354,13 @@ type
   PSEMid_ds = ^TSEMid_ds;
   PSEMid_ds = ^TSEMid_ds;
   TSEMid_ds = record
   TSEMid_ds = record
     sem_perm : tipc_perm;
     sem_perm : tipc_perm;
-    sem_otime : longint;
-    sem_ctime : longint;
+    sem_otime : time_t;
+    sem_ctime : time_t;
     sem_base         : pointer;
     sem_base         : pointer;
     sem_pending      : pointer;
     sem_pending      : pointer;
     sem_pending_last : pointer;
     sem_pending_last : pointer;
     undo             : pointer;
     undo             : pointer;
-    sem_nsems : word;
+    sem_nsems : cushort;
   end;
   end;
 {$else}
 {$else}
 
 

+ 4 - 10
rtl/win/wininc/base.inc

@@ -337,6 +337,10 @@
    Macros
    Macros
  }
  }
 
 
+  MakeIntResourceA = PAnsiChar;
+  MakeIntResourceW = PWideChar;
+  MakeIntResource = MakeIntResourceA;
+
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   function GetBValue(rgb : longint) : BYTE;
   function GetBValue(rgb : longint) : BYTE;
@@ -415,10 +419,6 @@
   { argument types are unknown }
   { argument types are unknown }
   function MAKEINTATOM(i : longint) : LPTSTR;
   function MAKEINTATOM(i : longint) : LPTSTR;
 
 
-  { was #define dname(params) def_expr }
-  { argument types are unknown }
-  function MAKEINTRESOURCE(i : longint) : LPTSTR;
-
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
@@ -825,12 +825,6 @@ type
        MAKEINTATOM:=LPTSTR(ULONG_PTR(WORD(i)));
        MAKEINTATOM:=LPTSTR(ULONG_PTR(WORD(i)));
     end;
     end;
 
 
-  { was #define dname(params) def_expr }
-  { argument types are unknown }
-  function MAKEINTRESOURCE(i : longint) : LPTSTR;
-    begin
-       MAKEINTRESOURCE:=LPTSTR(ULONG_PTR(WORD(i)));
-    end;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }

+ 31 - 153
rtl/win/wininc/defines.inc

@@ -1139,61 +1139,37 @@
   { EnumPrinters  }
   { EnumPrinters  }
   { EnumProtocols  }
   { EnumProtocols  }
   { EnumResLangProc  }
   { EnumResLangProc  }
-    { was #define dname def_expr }
-    function RT_ACCELERATOR : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_BITMAP : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_DIALOG : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_FONT : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_FONTDIR : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_MENU : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_RCDATA : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_STRING : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_MESSAGETABLE : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_CURSOR : LPTSTR;
-      { return type might be wrong }
 
 
-    { was #define dname def_expr }
-    function RT_GROUP_CURSOR : LPTSTR;
-      { return type might be wrong }
 
 
-    { was #define dname def_expr }
-    function RT_ICON : LPTSTR;
-      { return type might be wrong }
-
-    { was #define dname def_expr }
-    function RT_GROUP_ICON : LPTSTR;
-      { return type might be wrong }
+  //
+  // Predefined Resource Types
+  //
+  const
+    RT_CURSOR       = MAKEINTRESOURCE(1);
+    RT_BITMAP       = MAKEINTRESOURCE(2);
+    RT_ICON         = MAKEINTRESOURCE(3);
+    RT_MENU         = MAKEINTRESOURCE(4);
+    RT_DIALOG       = MAKEINTRESOURCE(5);
+    RT_STRING       = MAKEINTRESOURCE(6);
+    RT_FONTDIR      = MAKEINTRESOURCE(7);
+    RT_FONT         = MAKEINTRESOURCE(8);
+    RT_ACCELERATOR  = MAKEINTRESOURCE(9);
+    RT_RCDATA       = MAKEINTRESOURCE(10);
+    RT_MESSAGETABLE = MAKEINTRESOURCE(11);
+
+    DIFFERENCE = 11;
+
+    RT_GROUP_CURSOR = MAKEINTRESOURCE(ULONG_PTR(RT_CURSOR) + DIFFERENCE);
+    RT_GROUP_ICON = MAKEINTRESOURCE(ULONG_PTR(RT_ICON) + DIFFERENCE);
+    RT_VERSION    = MAKEINTRESOURCE(16);
+    RT_DLGINCLUDE = MAKEINTRESOURCE(17);
+    RT_PLUGPLAY   = MAKEINTRESOURCE(19);
+    RT_VXD        = MAKEINTRESOURCE(20);
+    RT_ANICURSOR  = MAKEINTRESOURCE(21);
+    RT_ANIICON    = MAKEINTRESOURCE(22);
+    RT_HTML       = MAKEINTRESOURCE(23);
+    RT_MANIFEST   = MAKEINTRESOURCE(24);
 
 
-    { was #define dname def_expr }
-    function RT_VERSION : LPTSTR;
-      { return type might be wrong }
 
 
   { EnumServicesStatus  }
   { EnumServicesStatus  }
 
 
@@ -2534,7 +2510,7 @@ Const
      LOCALE_RETURN_NUMBER  = $20000000;   // return number instead
      LOCALE_RETURN_NUMBER  = $20000000;   // return number instead
      LOCALE_SISO639LANGNAME = $59;
      LOCALE_SISO639LANGNAME = $59;
      LOCALE_SISO3166CTRYNAME = $5A;
      LOCALE_SISO3166CTRYNAME = $5A;
- 
+
   { Calendar Type Information  }
   { Calendar Type Information  }
      CAL_ICALINTVALUE = 1;
      CAL_ICALINTVALUE = 1;
      CAL_IYEAROFFSETRANGE = 3;
      CAL_IYEAROFFSETRANGE = 3;
@@ -5400,8 +5376,8 @@ Const
   DECLARE_HANDLE(HANDLE);
   DECLARE_HANDLE(HANDLE);
   #endif
   #endif
    *)
    *)
-   
-   
+
+
   const
   const
      EXCEPTION_READ_FAULT    = 0; // Access violation was caused by a read
      EXCEPTION_READ_FAULT    = 0; // Access violation was caused by a read
      EXCEPTION_WRITE_FAULT   = 1; // Access violation was caused by a write
      EXCEPTION_WRITE_FAULT   = 1; // Access violation was caused by a write
@@ -5567,104 +5543,6 @@ const
          UNICODE_NULL:=#0;
          UNICODE_NULL:=#0;
       end;
       end;
 
 
-    { was #define dname def_expr }
-    function RT_ACCELERATOR : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_ACCELERATOR:=MAKEINTRESOURCE(9);
-      end;
-
-    { was #define dname def_expr }
-    function RT_BITMAP : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_BITMAP:=MAKEINTRESOURCE(2);
-      end;
-
-    { was #define dname def_expr }
-    function RT_DIALOG : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_DIALOG:=MAKEINTRESOURCE(5);
-      end;
-
-    { was #define dname def_expr }
-    function RT_FONT : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_FONT:=MAKEINTRESOURCE(8);
-      end;
-
-    { was #define dname def_expr }
-    function RT_FONTDIR : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_FONTDIR:=MAKEINTRESOURCE(7);
-      end;
-
-    { was #define dname def_expr }
-    function RT_MENU : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_MENU:=MAKEINTRESOURCE(4);
-      end;
-
-    { was #define dname def_expr }
-    function RT_RCDATA : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_RCDATA:=MAKEINTRESOURCE(10);
-      end;
-
-    { was #define dname def_expr }
-    function RT_STRING : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_STRING:=MAKEINTRESOURCE(6);
-      end;
-
-    { was #define dname def_expr }
-    function RT_MESSAGETABLE : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_MESSAGETABLE:=MAKEINTRESOURCE(11);
-      end;
-
-    { was #define dname def_expr }
-    function RT_CURSOR : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_CURSOR:=MAKEINTRESOURCE(1);
-      end;
-
-    { was #define dname def_expr }
-    function RT_GROUP_CURSOR : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_GROUP_CURSOR:=MAKEINTRESOURCE(12);
-      end;
-
-    { was #define dname def_expr }
-    function RT_ICON : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_ICON:=MAKEINTRESOURCE(3);
-      end;
-
-    { was #define dname def_expr }
-    function RT_GROUP_ICON : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_GROUP_ICON:=MAKEINTRESOURCE(13);
-      end;
-
-    { was #define dname def_expr }
-    function RT_VERSION : LPTSTR;
-      { return type might be wrong }
-      begin
-         RT_VERSION:=MAKEINTRESOURCE(16);
-      end;
-
     { was #define dname def_expr }
     { was #define dname def_expr }
     function IDC_ARROW : LPTSTR;
     function IDC_ARROW : LPTSTR;
       { return type might be wrong }
       { return type might be wrong }

+ 7 - 7
rtl/wince/wininc/defines.inc

@@ -1155,8 +1155,8 @@
   { EnumProtocols  }
   { EnumProtocols  }
   { EnumResLangProc  }
   { EnumResLangProc  }
      RT_ACCELERATOR = MAKEINTRESOURCE(9);
      RT_ACCELERATOR = MAKEINTRESOURCE(9);
-	 RT_BITMAP = MAKEINTRESOURCE(2);
-	 RT_DIALOG = MAKEINTRESOURCE(5);
+     RT_BITMAP = MAKEINTRESOURCE(2);
+     RT_DIALOG = MAKEINTRESOURCE(5);
      RT_FONT = MAKEINTRESOURCE(8);
      RT_FONT = MAKEINTRESOURCE(8);
      RT_FONTDIR = MAKEINTRESOURCE(7);
      RT_FONTDIR = MAKEINTRESOURCE(7);
      RT_MENU = MAKEINTRESOURCE(4);
      RT_MENU = MAKEINTRESOURCE(4);
@@ -2070,7 +2070,7 @@
      ICC_TOOLTIP_CLASSES   = $00001000; // Tooltip static & button
      ICC_TOOLTIP_CLASSES   = $00001000; // Tooltip static & button
      ICC_CAPEDIT_CLASS     = $00002000; // All-caps edit control
      ICC_CAPEDIT_CLASS     = $00002000; // All-caps edit control
      ICC_FE_CLASSES        = $40000000; // FE specific input subclasses
      ICC_FE_CLASSES        = $40000000; // FE specific input subclasses
-     
+
   { InitializeSecurityDescriptor  }
   { InitializeSecurityDescriptor  }
      SECURITY_DESCRIPTOR_REVISION = 1;
      SECURITY_DESCRIPTOR_REVISION = 1;
   { IsTextUnicode  }
   { IsTextUnicode  }
@@ -2860,7 +2860,7 @@
      STILL_ACTIVE = $103;
      STILL_ACTIVE = $103;
 
 
   { kfuncs consts }  //+kfuncs
   { kfuncs consts }  //+kfuncs
-  
+
     {$ifdef CPUARM}
     {$ifdef CPUARM}
       PUserKData = $FFFFC800;
       PUserKData = $FFFFC800;
     {$else}
     {$else}
@@ -2892,7 +2892,7 @@
 
 
      TLS_FUNCALLOC    = 0;
      TLS_FUNCALLOC    = 0;
      TLS_FUNCFREE     = 1;
      TLS_FUNCFREE     = 1;
-     
+
   { COMMPROP structure  }
   { COMMPROP structure  }
      SP_SERIALCOMM = $1;
      SP_SERIALCOMM = $1;
      BAUD_075 = $1;
      BAUD_075 = $1;
@@ -3813,7 +3813,7 @@
      LVIS_SELECTED = 2;
      LVIS_SELECTED = 2;
      LVIS_OVERLAYMASK = 3840;
      LVIS_OVERLAYMASK = 3840;
      LVIS_STATEIMAGEMASK = 61440;
      LVIS_STATEIMAGEMASK = 61440;
-     
+
      // progress bar styles
      // progress bar styles
      PBS_SMOOTH              = 01;
      PBS_SMOOTH              = 01;
      PBS_VERTICAL            = 04;
      PBS_VERTICAL            = 04;
@@ -4871,7 +4871,7 @@
      VK_RMENU = 165;
      VK_RMENU = 165;
   { ImmGetVirtualKey  }
   { ImmGetVirtualKey  }
      VK_PROCESSKEY = 229;
      VK_PROCESSKEY = 229;
-     
+
      // these constants are xda-specific:
      // these constants are xda-specific:
      VK_TOUCHPAD   = $01; // VK_LBUTTON
      VK_TOUCHPAD   = $01; // VK_LBUTTON
      VK_ANSWER     = $72; // VK_F5
      VK_ANSWER     = $72; // VK_F5

+ 1 - 4
tests/test/units/dos/tdos2.pp

@@ -530,6 +530,7 @@ Begin
 {$IFDEF FPC}
 {$IFDEF FPC}
  FindClose(Search);
  FindClose(Search);
 {$ENDIF}
 {$ENDIF}
+
  if not FoundDir then
  if not FoundDir then
    WriteLn(s+'FAILURE. Did not find '+TestDir+' directory')
    WriteLn(s+'FAILURE. Did not find '+TestDir+' directory')
  else
  else
@@ -546,10 +547,6 @@ Begin
  else
  else
    WriteLn(s+'Success.');
    WriteLn(s+'Success.');
 
 
-{$IFDEF FPC}
- FindClose(Search);
-{$ENDIF}
-
 {$ifdef go32v2}
 {$ifdef go32v2}
  s:='Searching using ??? wildcard (normal files + all special files)...';
  s:='Searching using ??? wildcard (normal files + all special files)...';
  FindFirst('???',AnyFile,Search);
  FindFirst('???',AnyFile,Search);