Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-10

Compiler allows strange statement

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen
to Vincent Snijders

In my project I include JclCompression unit from jcl 2.01. Compilation ends with error:
Identifier not found "ULARGE_INTEGER"
in JclBase.pas.

The code defines ULARGE_INTEGER just before the error line, but only if FPC is not defined! Why so? Should ULARGE_INTEGER be defined somewhere in fpc libraries. Didn't find it.

// Redefinition of ULARGE_INTEGER to relieve dependency on Windows.pas
type
  {$IFNDEF FPC}
  PULARGE_INTEGER = ^ULARGE_INTEGER;
  {$EXTERNALSYM PULARGE_INTEGER}
  ULARGE_INTEGER = record
    case Integer of
    0:
     (LowPart: LongWord;
      HighPart: LongWord);
    1:
     (QuadPart: Int64);
  end;
  {$EXTERNALSYM ULARGE_INTEGER}
  {$ENDIF ~FPC}
  TJclULargeInteger = ULARGE_INTEGER;
  PJclULargeInteger = PULARGE_INTEGER;

Juha Manninen

Juha Manninen
to Juha Manninen

Uhh...
How to compile and build jcl?
Should I try an older version?
Now I have the latest public version jcl-2.01.3449-linux. I tried to compile the jcl package and got the same ULARGE_INTEGER error. Then I commented out the {$IFNDEF FPC} in JclBase.pas to let ULARGE_INTEGER be defined.
Then I get more errors, like
Error: Identifier not found "MultiByteToWideChar"
Error: Identifier not found "MB_PRECOMPOSED"
all related to Windows stuff.

What to do? Is this the end of my Lazarus / FPC porting?

Juha Manninen

Marco van de Voort
to Juha Manninen

In our previous episode, Juha Manninen said:

Show quoted text 12 lines
How to compile and build jcl? Should I try an older version? Now I have the latest public version jcl-2.01.3449-linux. I tried to compile the jcl package and got the same ULARGE_INTEGER error. Then I commented out the {$IFNDEF FPC} in JclBase.pas to let ULARGE_INTEGER be defined. Then I get more errors, like Error: Identifier not found "MultiByteToWideChar" Error: Identifier not found "MB_PRECOMPOSED" all related to Windows stuff. What to do? Is this the end of my Lazarus / FPC porting?

The JCL is not very portable, and worse, non-portable and portable parts are not very well separated. They have half of the units depending on units that try to read the borland debug format etc.

Juha Manninen
to Marco van de Voort

Hi,

The JCL is not very portable, and worse, non-portable and portable parts are not very well separated. They have half of the units depending on units that try to read the borland debug format etc.

It is strange because there are conditional compilation IFDEFs for FPC. Why to include them if the code doesn't compile anyway? Ugly code I would say. Too many conditionals and dependencies.

I could try to strip JclCompression unit so that only the essence or "real beaf" is left there. It needs lots of work and feels really stupid and useless.

How do other people handle this? In some post someone claimed that JCL compiles somehow under FPC. Well, it doesn't!

Juha Manninen

Graeme Geldenhuys
to Juha Manninen

2009/10/31 Juha Manninen :

It is strange because there are conditional compilation IFDEFs for FPC. Why to include them if the code doesn't compile anyway?

Just because there are IFDEFs doesn't mean it's complete. It is probably work in progress, but far from complete by the sounds of things - I don't really know JCL code.

Ugly code I would say. Too many conditionals and dependencies.

That's what you get if you don't use a compiler that is designed to be cross-platform. FPC with RTL, FCL and Lazarus LCL was designed to be cross-platform so IFDEFs like that are much less required.

I would suggest that if there is something specific you needed from JCL, then only rip that portion out and port that to FPC - that's if FPC doesn't already include similar functionality in the FCL.

I could try to strip JclCompression unit so that only the essence or "real

Which compression algorithm are you looking for. I think I saw compression algorithm code in FCL before. gzip is definitely there

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/
Juha Manninen
to Graeme Geldenhuys

Hi,

Which compression algorithm are you looking for. I think I saw compression algorithm code in FCL before. gzip is definitely there

I used zlib compression which is the same as gzip I guess. Then I used also the more efficient bzip2 compression with TJclBZIP2CompressionStream and TJclBZIP2DeCompressionStream. I can look for the alternatives elsewhere.

Juha Manninen

Vincent Snijders
to Juha Manninen
Juha Manninen wrote 10 lines
> Please, create a new email message, instead of replying to an existing > one and changing the subject of it. > > This message has nothing to do with the "Compiler allows strange > statement" - thread: > http://lists.freepascal.org/lists/fpc-pascal/2009-October/thread.html#22885 Oops, sorry. I will do that. Where does the thread information come from? It looks good in my email client and I don't see any extra data.

Each message gets a id, like:

When you reply to it, this ID is added the reference message header.

Vincent