Re: [fpc-pascal] os dependency with ifdef

2006-03-18 Thread Marc Santhoff
Am Freitag, den 17.03.2006, 15:26 -0300 schrieb Felipe Monteiro de
Carvalho:
> Hello,
> 
> On 3/16/06, Marc Santhoff <[EMAIL PROTECTED]> wrote:
> > Since I'm still fiddling with reading the serial port I have the idea
> > that linux and even MacOS may be very similar to my main os FreeBSD.
> >
> > I do know Win32 is different, but how similar are the other os'ses?
> 
> You can mostly assume that if it works for Linux, then it will work
> for FreeBSD and all other BSDs and even Solaris (and vice-versa).
> 
> This isn´t true for Mac OS X. Althought it is based on FreeBSD, it is
> very, very different from standard unix boxes.

I see, this is very valuable information.

> > Is there any code in the FCL or the like I can study for getting my
> > ifdefs right?
> 
> I used ifdefs to write two cross-platform projects: TTrayIcon
> component and the Virtual Magnifying Glass. You can see their codes on
> the internet.

Since I'm dealing with non-visible, non-component code I'll try making
portable units out of it.

Maybe I'm coming back on this when the basics are done and the code
using these units is in shape for building a component.

Thank you very much,
Marc


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


Re: [fpc-pascal] os dependency with ifdef

2006-03-18 Thread Jonas Maebe


On 17 Mar 2006, at 19:26, Felipe Monteiro de Carvalho wrote:


You can mostly assume that if it works for Linux, then it will work
for FreeBSD and all other BSDs and even Solaris (and vice-versa).

This isn´t true for Mac OS X. Althought it is based on FreeBSD, it is
very, very different from standard unix boxes.


It shares at least 90% of the rtl with the other BSD's, so it isn't  
that different at the basic unix level. It's mainly different if you  
want to use OS X-specific functionality (like its gui environment  
instead of X11). Regarding serial port stuff: none of the Macs which  
can run the latest version of Mac OS X still has a serial port. There  
are USB-serial converters out there though, and their drivers (.e.g  
from Keyspan) create a regular serial port device in /dev which works  
identically to those under other unixes.


It's not because other interfaces are available, that there is no  
compatibility with the traditional unix way of working.



Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Problem with h2pas

2006-03-18 Thread Felipe Monteiro de Carvalho
Hello,

I am trying to use h2pas to convert the rest of ImageMagick headers.
On a file that contains only 3 lines of code:

extern MagickExport MagickBooleanType
  AnimateImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *),
  AnimateImages(const ImageInfo *,Image *);

h2pas gives me a generic "syntax error" error pointing to the 2nd line
of code =(

any ideas? (or other conversion tools)

thanks,
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problem with h2pas

2006-03-18 Thread Michael Van Canneyt


On Sat, 18 Mar 2006, Felipe Monteiro de Carvalho wrote:

> Hello,
> 
> I am trying to use h2pas to convert the rest of ImageMagick headers.
> On a file that contains only 3 lines of code:
> 
> extern MagickExport MagickBooleanType
>   AnimateImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *),
>   AnimateImages(const ImageInfo *,Image *);
> 
> h2pas gives me a generic "syntax error" error pointing to the 2nd line
> of code =(
> 
> any ideas? (or other conversion tools)

The problem is the 'MagickExport'. Remove that and it'll work fine. 
This is a macro, and h2pas does not support macros.

One thing to do is to run each .h file through gcc -E first.

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


Re: [fpc-pascal] Problem with h2pas

2006-03-18 Thread Felipe Monteiro de Carvalho
On 3/18/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> The problem is the 'MagickExport'. Remove that and it'll work fine.
> This is a macro, and h2pas does not support macros.

Ok, I removed it and h2pas doesn't complain now.

One more problem occured, however. On this declaration:

extern MagickExport MagickBooleanType
 AnimateImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *),
 AnimateImages(const ImageInfo *,Image *);

It only creates the first function. It ignores the second. Apparently
h2pas doesn't support this kind of declaration.

thanks,
--
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal