Re: [fpc-pascal] Prospects for running Lightspeed/THINK Pascal and Codewarrior Pascal with FPC

2014-08-21 Thread Jonas Maebe

On 21/08/14 07:41, Jerry wrote:

I have a lot of old Pascal that I am getting interested in reviving. It was 
originally written in Lightspeed/THINK Pascal (did I mention it is old?) and 
around 2000-2002 I converted it to Codewarrior Pascal. These are both Macintosh 
dialects.

What are the prospects of running each of these dialects under FPC? Are there 
compatibility flags to set? Would there be much rewriting?


The compatibility flag to set is the compiler directive {$mode macpas} 
(at the top of the file), or the command line switch -Mmacpas. I don't 
know how much there would be to rewrite, but in general that switch 
should make the accepted syntax at least quite compatible to CodeWarrior's.



One of the things that I recall being possibly unique and possibly troublesome 
now is that under THINK Pascal, there was a built-in text I/O window and a 
built-in graphics drawing window, both of which I used. In the latter case, it 
was mainly MoveTo(x, y) and LineTo(x, y) stuff. When I moved to Codewarrior, I 
was somehow able to emulate that both text and drawing windows. I suppose the 
text window became a normal terminal (whatever Codewarrior offered). I can't 
remember if Codewarrior offered a drawing window or if I had to make a crude 
one using a (now) Carbon window.


Maybe you could rewrite your code on top of TransSkel: 
http://ragnemalm.se/lightweight/ (click on it in the navigation bar on 
the left).



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Prospects for running Lightspeed/THINK Pascal and Codewarrior Pascal with FPC

2014-08-21 Thread Ingemar Ragnemalm

On 21/08/14 07:41, Jerry wrote:

I have a lot of old Pascal that I am getting interested in reviving. It was 
originally written in Lightspeed/THINK Pascal (did I mention it is old?) and 
around 2000-2002 I converted it to Codewarrior Pascal. These are both Macintosh 
dialects.

What are the prospects of running each of these dialects under FPC? Are there 
compatibility flags to set? Would there be much rewriting?



The compatibility flag to set is the compiler directive {$mode macpas} 
(at the top of the file), or the command line switch -Mmacpas. I don't 
know how much there would be to rewrite, but in general that switch 
should make the accepted syntax at least quite compatible to CodeWarrior's.


  

One of the things that I recall being possibly unique and possibly troublesome 
now is that under THINK Pascal, there was a built-in text I/O window and a 
built-in graphics drawing window, both of which I used. In the latter case, it 
was mainly MoveTo(x, y) and LineTo(x, y) stuff. When I moved to Codewarrior, I 
was somehow able to emulate that both text and drawing windows. I suppose the 
text window became a normal terminal (whatever Codewarrior offered). I can't 
remember if Codewarrior offered a drawing window or if I had to make a crude 
one using a (now) Carbon window.



Maybe you could rewrite your code on top of TransSkel: 
http://ragnemalm.se/lightweight/ (click on it in the navigation bar on 
the left).
  


Thanks, Jonas!

I am very comfortable in porting old Mac code to FPC. FPC implements a 
very nice and modern Pascal that handles most (but not all) old code. 
The only problem I have had is with multiply nested code that does 
exit on the enclosing function, which FPC can't do.


You have to make your own text/drawing windows, but that is fairly easy. 
If you program for Carbon, your code can be pretty close to the old one, 
and you can even use QuickDraw, but if you want to be a bit more future 
safe, TransSkel 5 targets Cocoa, includes a partial replacement for much 
of the Mac Toolbox GUI and a future safe QuickDraw layer, QDCG, where 
all those MoveTo/LineTo should work just fine.


And if you want an IDE that is somewhat similar to Think, Lightweight 
IDE is aiming in that direction. The debugger needs more work but we are 
quite active right now so the plan is to fix the remaining limitations 
during the coming months. (The latest upload was today.)



/Ingemar

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] LoadLibrary(freeBSDlibrary) does not work...

2014-08-21 Thread fredvs
Hello.

I try to dynamically load libraries in freeBSD 64 bit with
DynLibs.LoadLibrary(reeBSDlibrary), with a fpc-64-bit-freeBSD application
(compilation has no errors.)

But at LoadLibrary(freeBSDlibrary), program crash... ;-)

Here the error message from gdb =

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 808406400 (LWP 100359/deviceinfos)]
 0x in ?? ()

I have try on a simple fpc-64-bit-freeBSD application to load
64-bit-freeBSD-libraries, 32-bit-freeBSD-libraries and
32-bit-Linux-libraries. = all crash...

Is the problem known and does it exist a solution ?

Thanks.

PS: I have experience on using DynLibs.LoadLibrary, i do not have that
problem with Windows, Linux and OSX.

Fred



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/LoadLibrary-freeBSDlibrary-does-not-work-tp5719943.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] LoadLibrary(freeBSDlibrary) does not work...

2014-08-21 Thread fredvs
Hum, little rectif... 

It seems that LoadLibrary is not the guilty. I was able to dynamically load
some freeBSD 64 bit libraries.

The crash comes somewhere else, (maybe from DynLibs.GetProcedureAddress).

I will do more investigations to find what is wrong with dealing libraries
for fpc applications in freeBSD.

Write you later...



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/LoadLibrary-freeBSDlibrary-does-not-work-tp5719943p5719944.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal