[fpc-pascal] IDE problem

2009-05-31 Thread Graham Benyon-Tinker
I have recently installed version 2.2.4, and now I have a problem with the IDE.
(Operating system Windows XP)
If I launch fp directly, IDE opens in a window with 80x80 display, and I can 
open a previously created source file within this window, and it all works fine.
BUT if I click on the source file directly to open it, IDE opens in full screen 
mode with 40x25 display, and this is horrid! This used not to happen with the 
previous version I had (version 1.something), when it would open in a window 
with 80x80 display, the same as when starting IDE directly.
I can't find anything in the documentation to help me resolve this problem, can 
anyone suggest how I can get round this problem?
Graham Benyon-Tinker

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

Re: [fpc-pascal] IDE problem

2009-05-31 Thread Marco van de Voort
In our previous episode, Graham Benyon-Tinker said:
> I have recently installed version 2.2.4, and now I have a problem with the 
> IDE.
> (Operating system Windows XP)
> If I launch fp directly, IDE opens in a window with 80x80 display, and I can 
> open a previously created source file within this window, and it all works 
> fine.
> BUT if I click on the source file directly to open it, IDE opens in full 
> screen mode with 40x25 display, and this is horrid! This used not to happen 
> with the previous version I had (version 1.something), when it would open in 
> a window with 80x80 display, the same as when starting IDE directly.
> I can't find anything in the documentation to help me resolve this problem, 
> can anyone suggest how I can get round this problem?

Probably the IDE can't find it files, which could mean that the fpc
directory is not in the path, or something is wrong with the working
directory when a .pp is selected.

I typically use the IDE from a cmd box, so I don't know exactly how this is
supposed to work.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Fwd: [fpc-pascal] IDE problem

2009-05-31 Thread Jonas Maebe
Forwarding to the original poster, since he's not subscribed to the  
mailing list.


To the original poster: please always mention the above fact (or set a  
reply-to field), because otherwise people who reply have no idea that  
you won't see their message (unless they are, like me, a moderator of  
the mailing list who let your message through).



Begin forwarded message:


From: mar...@stack.nl (Marco van de Voort)
Date: Sun 31 May 2009 12:27:50 GMT+02:00
To: FPC-Pascal users discussions 
Subject: Re: [fpc-pascal] IDE problem
Reply-To: FPC-Pascal users discussions >


In our previous episode, Graham Benyon-Tinker said:
I have recently installed version 2.2.4, and now I have a problem  
with the IDE.

(Operating system Windows XP)
If I launch fp directly, IDE opens in a window with 80x80 display,  
and I can open a previously created source file within this window,  
and it all works fine.
BUT if I click on the source file directly to open it, IDE opens in  
full screen mode with 40x25 display, and this is horrid! This used  
not to happen with the previous version I had (version  
1.something), when it would open in a window with 80x80 display,  
the same as when starting IDE directly.
I can't find anything in the documentation to help me resolve this  
problem, can anyone suggest how I can get round this problem?


Probably the IDE can't find it files, which could mean that the fpc
directory is not in the path, or something is wrong with the working
directory when a .pp is selected.

I typically use the IDE from a cmd box, so I don't know exactly how  
this is

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


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


[fpc-pascal] DirectFB for FPC beta tarball

2009-05-31 Thread Roland Schaefer
Hello. There wasn't much feedback to our previous anouncement. Anyway,
now there is an FPC-DirectFB tarball which can be downloaded from our
SourceForge page: http://sourceforge.net/projects/wiseslap/ Please have
DFB 1.0.1 or higher installed. One sample program is included.

The known major bugs of previous SVN versions have beeen fixed. We're
now starting to actually use DFB in our project. Reports (bugs or
anything) are thus highly appreciated.

For information on DFB visit: http://www.directfb.org/

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


Re: [fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

2009-05-31 Thread Coco Pascal

Marco van de Voort schreef:

In our previous episode, Coco Pascal said:
  
I have a library with udf routines using the cdecl calling convention, 
required by Firebird. This seems to work well on win32.



How exactly?
  

?

function Y_Odd(const AValue: Int64): LongInt; cdecl; export;
begin
 if Odd(AValue) then
   Result := -1
 else
   Result := 0;
end; {Y_Odd}

exports

Y_Odd;

This works fine with Firebird. If I declare the stdcall calling 
convention Firebird can't find its entrypoint.


  
However when I test these routines with a fpc win32 app declaring 
external functions with the cdecl or stdcall calling convention gives me 
a 'entrypoint not found' error. I assume cdecl is obligatory, but can I 
implement that?



Maybe it is a matter of an underscore prefix. Write the declaration full
(cdecl external libname name '_symbol';

and experiment with leaving the underscore there or not.

It might also be the need to declare a libname. Windows and OS X afaik have 
separate
linker namespaces for external libs, so you need to declare the name of the
module they are in.
  
  function Y_Odd(const AValue: Int64): LongInt; cdecl; external LibName 
name 'libyfbudf.dll';

gives me an  Identifier not found "LibName" error.

  function Y_Odd(const AValue: Int64): LongInt; cdecl; external 
'_libyfbudf.dll';

gives me a File not found _libyfbudf.dll.



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


[fpc-pascal] Firebird +lin32 + fpc lib udf returns garbage.

2009-05-31 Thread Coco Pascal
If I build a library with udf functions for Firebird tests with an fpc 
app calling those routines works fine. However with Firebird module and 
entrypoint are found but garbage is returned.


function vv(const AValue: LongInt): LongInt; cdecl; export;
begin
 Result := AValue;
end;

declare external function vv
integer
returns integer by value
entry_point 'vv' module_name 'libyfbudf';

select vv(13) from rdb$database;
returns -12350740

All variations of the input parameter return the same result.

What can I do? Has anybody succesfully created a Firebird udf library on 
lin32?


(The same module build with fpc win32 works fine with Firebird win32.)

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


Re: [fpc-pascal] DirectFB for FPC beta tarball

2009-05-31 Thread Michael Van Canneyt



On Sun, 31 May 2009, Roland Schaefer wrote:


Hello. There wasn't much feedback to our previous anouncement. Anyway,
now there is an FPC-DirectFB tarball which can be downloaded from our
SourceForge page: http://sourceforge.net/projects/wiseslap/ Please have
DFB 1.0.1 or higher installed. One sample program is included.

The known major bugs of previous SVN versions have beeen fixed. We're
now starting to actually use DFB in our project. Reports (bugs or
anything) are thus highly appreciated.


Do you think it would be feasible to use this as a basis for a Lazarus 
widgetset ?
Lazarus without X would be quite cool.

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


Re: [fpc-pascal] DirectFB for FPC beta tarball

2009-05-31 Thread Micha Nelissen

Michael Van Canneyt wrote:

The known major bugs of previous SVN versions have beeen fixed. We're
now starting to actually use DFB in our project. Reports (bugs or
anything) are thus highly appreciated.


Do you think it would be feasible to use this as a basis for a Lazarus 
widgetset ?

Lazarus without X would be quite cool.


I already have it running, using gtk2 :P

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


Re: [fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

2009-05-31 Thread Jonas Maebe


On 31 May 2009, at 15:28, Coco Pascal wrote:


Marco van de Voort schreef:

In our previous episode, Coco Pascal said:

I have a library with udf routines using the cdecl calling  
convention, required by Firebird. This seems to work well on win32.


How exactly?



?

function Y_Odd(const AValue: Int64): LongInt; cdecl; export;
begin
if Odd(AValue) then
  Result := -1
else
  Result := 0;
end; {Y_Odd}

exports

Y_Odd;

This works fine with Firebird. If I declare the stdcall calling  
convention Firebird can't find its entrypoint.


cdecl automatically enables C-compiler-compatible name mangling for  
exported procedures. stdcall doesn't. So it's normal that Firebird  
does not find the entrypoint when using stdcall, as it does not  
support FPC-style name mangling.


There is no way to get C name mangling without the calling convention,  
so you have to manually declare an alias in that case. E.g.,


function Y_Odd(const AValue: Int64): LongInt; cdecl; alias:  
'_Y_Odd'; export;


Whether or not you need an extra underscore before the alias name  
depends on the target platform. Win32 requires one.



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


Re: [fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

2009-05-31 Thread Coco Pascal

Jonas Maebe schreef:


On 31 May 2009, at 15:28, Coco Pascal wrote:


Marco van de Voort schreef:

In our previous episode, Coco Pascal said:

I have a library with udf routines using the cdecl calling 
convention, required by Firebird. This seems to work well on win32.


How exactly?



?

function Y_Odd(const AValue: Int64): LongInt; cdecl; export;
begin
if Odd(AValue) then
  Result := -1
else
  Result := 0;
end; {Y_Odd}

exports

Y_Odd;

This works fine with Firebird. If I declare the stdcall calling 
convention Firebird can't find its entrypoint.


cdecl automatically enables C-compiler-compatible name mangling for 
exported procedures. stdcall doesn't. So it's normal that Firebird 
does not find the entrypoint when using stdcall, as it does not 
support FPC-style name mangling.


There is no way to get C name mangling without the calling convention, 
so you have to manually declare an alias in that case. E.g.,


function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: '_Y_Odd'; 
export;


Whether or not you need an extra underscore before the alias name 
depends on the target platform. Win32 requires one.



I tried
function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: '_Y_Odd'; 
export;

and
function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: '__Y_Odd'; 
export;
but still I get the message entrypoint of 'Y_Odd' could not be found in 
'libyfbudf.dll'

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


Re: [fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

2009-05-31 Thread Jonas Maebe


On 31 May 2009, at 20:05, Coco Pascal wrote:


I tried
function Y_Odd(const AValue: Int64): LongInt; cdecl; alias:  
'_Y_Odd'; export;

and
function Y_Odd(const AValue: Int64): LongInt; cdecl; alias:  
'__Y_Odd'; export;
but still I get the message entrypoint of 'Y_Odd' could not be found  
in 'libyfbudf.dll'


Then you may want to use some tool to look at the name of the entry  
point in the dll for the cdecl case, and compare it to the stdcall  
case. Since I don't use Windows, I cannot help you with this.



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


Re: [fpc-pascal] "Aborting " a socket operation under Linux

2009-05-31 Thread Luca Olivetti

En/na Luca Olivetti ha escrit:

En/na Rainer Stratmann ha escrit:

Am Freitag, 29. Mai 2009 20:29 schrieb Luca Olivetti:

En/na Rainer Stratmann ha escrit:

May be socketoption so_linger would be a solutuion.
http://www.developerweb.net/forum/archive/index.php/t-2982.html

Nope, no change.



I'm testing a connect to a non existent host in the thread and it won't
terminate before the (quite long, 3 minutes, since it ignores the 5
seconds I set) timeout, no matter what the value of linger->l_onoff


In case of connection to a host:
Simply use nonblocking socket mode, than you get immediately a result.
And then you can write your own timeout function.


Ok, the problem was that synapse used an integer instead of a timeval 
for SO_SNDTIMEO/SO_RCVTIMEO. I don't want to rewrite synapse and I want 
my program to work at least under windows and linux, so the nonblocking 
way is not an option.
*However* that's not my problem: I expect that a close would interrupt 
the socket operation (so the thread can terminate) and it doesn't.


Well, I tried with a c program and it does the same (closing the socket 
from the main program doesn't interrupt the ongoing connect in a 
thread), so it's not a freepascal problem.
Googling for a way to abort the socket operation this mailing list 
thread is the first result, so I guess that there's no way to do it :-(



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


Re: [fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

2009-05-31 Thread Coco Pascal

Jonas Maebe schreef:


On 31 May 2009, at 20:05, Coco Pascal wrote:


I tried
function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: '_Y_Odd'; 
export;

and
function Y_Odd(const AValue: Int64): LongInt; cdecl; alias: 
'__Y_Odd'; export;
but still I get the message entrypoint of 'Y_Odd' could not be found 
in 'libyfbudf.dll'


Then you may want to use some tool to look at the name of the entry 
point in the dll for the cdecl case, and compare it to the stdcall 
case. Since I don't use Windows, I cannot help you with this.




Thanks for the tip! The name in the dll is _Y_Odd indeed.
Is it not the function header in the dll that must extended with alias: 
'_Y_Odd'. The function declaration in the app should be:
function _Y_Odd(const AValue: Int64): LongInt; cdecl; external 
'libyfbudf.dll';


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