Recent

Author Topic: compiler error in unit  (Read 342 times)

paule32

  • Full Member
  • ***
  • Posts: 233
compiler error in unit
« on: April 23, 2024, 01:36:37 pm »
Hello,
during compile, I stuck on line: 57 (see attached image).
I get the compiler error:
FPC_WinTypes.pas(57) Fatal: Syntax error, "UNIT" expected but "end of file" found

And this is the content:

Code: Pascal  [Select][+][-]
  1. // ---------------------------------------------------------------------------
  2. // File:   FPC_WinTypes.pas
  3. // Author: (c) 2024 Jens Kallup - paule32
  4. // All rights reserved
  5. //
  6. // only for education, and non-profit usage !
  7. // ---------------------------------------------------------------------------
  8. unit FPC_WinTypes;
  9. interface
  10.  
  11. uses fpc_types;
  12. // ---------------------------------------------------------------------------
  13. // win32api constants, and variables ...
  14. // ---------------------------------------------------------------------------
  15. type BOOL      = LongBool;       // true or false
  16.  
  17. type PVOID     = Pointer;
  18. type LPVOID    = ^PVOID;
  19. type LPCVOID   = ^LPVOID;
  20.  
  21. type HANDLE    = PVOID;
  22. type FARPROC   = PVOID;
  23.  
  24. type THANDLE   =    DWORD;      // onject handle
  25. type PHandle   = ^THANDLE;
  26.  
  27. type LCID      = DWord;         // a local identifier
  28. type LANGID    = DWord;         // a language identifier
  29.  
  30. type WPARAM    = DWord;         // 32-bit message parameter
  31. type LPARAM    = DWord;         // 32-bit message parameter
  32.  
  33. type LRESULT   = DWord;         // 32-bit unsigned return value
  34. type HRESULT   = DWord;         // 32-bit signed   return value
  35.  
  36. type HINSTANCE = HANDLE;        // a handle to an instance
  37. type HLOCAL    = HANDLE;        // a handle to a local memory block
  38. type HMODULE   = HINSTANCE;     // a handle to a module (.dll)
  39.  
  40. type HWND      = DWord;         // a handle to a window
  41. type ATOM      = DWord;         // local/global atom index for a string
  42.  
  43. type HGLOBAL   = THandle;       // a globally memory allocated handle
  44.  
  45. type PAnsiString = ^AnsiString;
  46. type LPCSTR      = PAnsiString;
  47. type LPCWSTR     = PAnsiString;
  48.  
  49. //type FARPROC   = Pointer;
  50.  
  51. type LPCTSTR   = LPCSTR;
  52.  
  53. type LONG_PTR  = DWORD;
  54. type PLONC_PTR = ^LONG_PTR;
  55.  
  56. type
  57.     PPoint = ^TPoint;
  58.     TPoint = record
  59.         x: DWORD;
  60.         y: DWORD;
  61.     end;
  62. type
  63.     PMessage = ^TMessage;
  64.     TMessage = record
  65.         hwnd     : HWND;
  66.         message  : DWORD;
  67.         wParam   : WPARAM;
  68.         lParam   : LPARAM;
  69.         time     : DWORD;
  70.         pt       : TPOINT;
  71.         lPrivate : DWORD;
  72.     end;
  73. // ---------------------------------------------------------------------------
  74. // security structures ...
  75. // ---------------------------------------------------------------------------
  76. type
  77.     POverlapped = ^TOverlapped;
  78.     _OVERLAPPED = record
  79.         Internal      : ^DWORD ;
  80.         InternalHigh  : ^DWORD ;
  81.         Offset        :  DWORD ;
  82.         OffsetHigh    :  DWORD ;
  83.         hEvent        : THandle;
  84.     end;
  85.     TOverlapped = _OVERLAPPED;
  86.  
  87.     PSECURITY_ATTRIBUTES  = ^TSECURITYATTRIBUTES;
  88.     LPSECURITY_ATTRIBUTES = ^TSECURITYATTRIBUTES;
  89.     PSecurityAttributes   = ^TSecurityAttributes;
  90.     TSECURITYATTRIBUTES  = record
  91.         nLength              : DWORD  ;
  92.         lpSecurityDescriptor : Pointer;
  93.         bInheritHandle       : BOOL   ;
  94.     end;
  95.  
  96. implementation
  97.  
  98. end.

So, what is going on ?

Zvoni

  • Hero Member
  • *****
  • Posts: 2362
Re: compiler error in unit
« Reply #1 on: April 23, 2024, 01:45:44 pm »
TPoint already declared in different unit?

btw: Is Line 54 a Typo? PLONC
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

paule32

  • Full Member
  • ***
  • Posts: 233
Re: compiler error in unit
« Reply #2 on: April 23, 2024, 03:49:50 pm »
damm, yes, indeed...
I working on two different copies.

sorry...

 

TinyPortal © 2005-2018