[fpc-pascal] $LINKLIB or $LINK in Lazarus/FPC on Mac OSX

2013-05-02 Thread m...@rpzdesign.com

Hello:

I am new to the list, I have posted on the forum, but I don't really 
know where the center of gravity is for this FPC/Lazarus Community,
so I will post on the mailing lists as well.  And then I do not know if 
the Mac List is well subscribed or just the general fpc-pascal list is 
better

subscribed.

I am trying to compile C code with Xcode into a static library or static 
object files.  I already have a mylib.a file ready to link

if I could just figure out the $LINKLIB syntax of dot.a library files.

I want to use either $LINKLIB or $LINK compiler directives to tell 
freepascal/lazarus to link the code STATICALLY into my binary.


The $LINK would require an object file, so I would need to dig around 
xcode to find out there the bloody thing puts the intermediate

object files (Maybe Mach-O?)

What I am trying to avoid is linking to a dylib dynamically.   Only 
static linking for some portions of the code.


Thanks for any feedback,

md

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


[fpc-pascal] CoreFoundation Freepascal MAC OSX

2013-05-04 Thread m...@rpzdesign.com

Anybody have any success with the included units for
CoreFoundation on Mac OSX.



I was trying to use CFSetGetCount( ) function call, it is clearly 
defined in CFSet.pas

and yet the linker error is:

Identifier Not Found "CFSetGetCount"

But magically, the constants from CFBase.pas compile OK, so it must
be the compiler directives at the top of CFSET.pas that are preventing
that code from getting included and visible by the compiler.

#
program testcfset;

uses
  CFBase, CFSet ;
var
 fcnt : single ;
 ret : integer ;
begin
 fcnt := kCFCoreFoundationVersionNumber10_2 ;
 ret := CFSetGetCount(nil) ;
end.

{  Compiler messages Below:
testcfset.lpr(6,2) Note: Local variable "fcnt" is assigned but never used
testcfset.lpr(7,2) Note: Local variable "ret" is assigned but never used
ld: symbol(s) not found for architecture i386
Undefined symbols for architecture i386:
  "_CFSetGetCount", referenced from:
  _PASCALMAIN in testcfset.o
ld: symbol(s) not found for architecture i386
An error occurred while linking
testcfset.lpr(10,2) Error: Error while linking
testcfset.lpr(10,2) Fatal: There were 1 errors compiling module, stopping
}
##

On another project before I built the test project,
I saw these errors:

ld : symbol(s) not found for architecture i386.

Undefined symbols for architecture i386:
"_CFSetGetCount" referenced from : (my code mangled name)

Anybody have a clue how to force the compiler to see and use CFSet.ppu
from inside /usr/local/lib/fpc/2.6.2/

My machine in Mac Mini 2010 with OSX Lion and XCode 4.6.2 Apr 15 with 
command line tools of same date.


I am working under Lazarus 1.08.  All the PPU files are where they 
should be.


Somebody from the Mac Guru crowd have any comments

Thanks,

md
program testcfset;

uses
  CFBase, CFSet ;
var
 fcnt : single ;
 ret : integer ;
begin
 fcnt := kCFCoreFoundationVersionNumber10_2 ;
 ret := CFSetGetCount(nil) ;
end.

{
testcfset.lpr(6,2) Note: Local variable "fcnt" is assigned but never used
testcfset.lpr(7,2) Note: Local variable "ret" is assigned but never used
ld: symbol(s) not found for architecture i386
Undefined symbols for architecture i386:
  "_CFSetGetCount", referenced from:
  _PASCALMAIN in testcfset.o
ld: symbol(s) not found for architecture i386
An error occurred while linking
testcfset.lpr(10,2) Error: Error while linking
testcfset.lpr(10,2) Fatal: There were 1 errors compiling module, stopping
}
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CoreFoundation Freepascal MAC OSX

2013-05-05 Thread m...@rpzdesign.com

I thought of a trick to get around this.

Using XCode, I can build a static library to get me access to the 
functions that I need.


But that is not really the point, I would like my freepascal environment 
to be correct
and to be able to use the functions contained in interface files like 
cfset.pas.


Any comment

Cheers,

md

On 5/4/2013 10:20 PM, m...@rpzdesign.com wrote:

Anybody have any success with the included units for
CoreFoundation on Mac OSX.



I was trying to use CFSetGetCount( ) function call, it is clearly 
defined in CFSet.pas

and yet the linker error is:

Identifier Not Found "CFSetGetCount"

But magically, the constants from CFBase.pas compile OK, so it must
be the compiler directives at the top of CFSET.pas that are preventing
that code from getting included and visible by the compiler.

#
program testcfset;

uses
  CFBase, CFSet ;
var
 fcnt : single ;
 ret : integer ;
begin
 fcnt := kCFCoreFoundationVersionNumber10_2 ;
 ret := CFSetGetCount(nil) ;
end.

{  Compiler messages Below:
testcfset.lpr(6,2) Note: Local variable "fcnt" is assigned but never used
testcfset.lpr(7,2) Note: Local variable "ret" is assigned but never used
ld: symbol(s) not found for architecture i386
Undefined symbols for architecture i386:
  "_CFSetGetCount", referenced from:
  _PASCALMAIN in testcfset.o
ld: symbol(s) not found for architecture i386
An error occurred while linking
testcfset.lpr(10,2) Error: Error while linking
testcfset.lpr(10,2) Fatal: There were 1 errors compiling module, stopping
}
##

On another project before I built the test project,
I saw these errors:

ld : symbol(s) not found for architecture i386.

Undefined symbols for architecture i386:
"_CFSetGetCount" referenced from : (my code mangled name)

Anybody have a clue how to force the compiler to see and use CFSet.ppu
from inside /usr/local/lib/fpc/2.6.2/

My machine in Mac Mini 2010 with OSX Lion and XCode 4.6.2 Apr 15 with 
command line tools of same date.


I am working under Lazarus 1.08.  All the PPU files are where they 
should be.


Somebody from the Mac Guru crowd have any comments

Thanks,

md


___
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

Re: [fpc-pascal] CoreFoundation Freepascal MAC OSX

2013-05-05 Thread m...@rpzdesign.com

Well, that trick did not work so well.

I was forced to finally copy the system library to a common development 
directory
and renaming CoreFoundation -> libCoreFoundation.a and copying the 
function call

out of CFSet.pas into my own pascal unit file.

Only then did I get the linker to work correctly and finish constructing 
the binary.


This of course says nothing about all that interface code sitting down 
in /usr/local/xxx/CFSet.pas, which is part

of the core foundation.

So again, any comments this week from the freepascal team, that would be 
great.


Cheers,

md


On 5/5/2013 6:31 AM, m...@rpzdesign.com wrote:

I thought of a trick to get around this.

Using XCode, I can build a static library to get me access to the 
functions that I need.


But that is not really the point, I would like my freepascal 
environment to be correct
and to be able to use the functions contained in interface files like 
cfset.pas.


Any comment

Cheers,

md

On 5/4/2013 10:20 PM, m...@rpzdesign.com wrote:

Anybody have any success with the included units for
CoreFoundation on Mac OSX.



I was trying to use CFSetGetCount( ) function call, it is clearly 
defined in CFSet.pas

and yet the linker error is:

Identifier Not Found "CFSetGetCount"

But magically, the constants from CFBase.pas compile OK, so it must
be the compiler directives at the top of CFSET.pas that are preventing
that code from getting included and visible by the compiler.

#
program testcfset;

uses
  CFBase, CFSet ;
var
 fcnt : single ;
 ret : integer ;
begin
 fcnt := kCFCoreFoundationVersionNumber10_2 ;
 ret := CFSetGetCount(nil) ;
end.

{  Compiler messages Below:
testcfset.lpr(6,2) Note: Local variable "fcnt" is assigned but never 
used

testcfset.lpr(7,2) Note: Local variable "ret" is assigned but never used
ld: symbol(s) not found for architecture i386
Undefined symbols for architecture i386:
  "_CFSetGetCount", referenced from:
  _PASCALMAIN in testcfset.o
ld: symbol(s) not found for architecture i386
An error occurred while linking
testcfset.lpr(10,2) Error: Error while linking
testcfset.lpr(10,2) Fatal: There were 1 errors compiling module, 
stopping

}
##

On another project before I built the test project,
I saw these errors:

ld : symbol(s) not found for architecture i386.

Undefined symbols for architecture i386:
"_CFSetGetCount" referenced from : (my code mangled name)

Anybody have a clue how to force the compiler to see and use CFSet.ppu
from inside /usr/local/lib/fpc/2.6.2/

My machine in Mac Mini 2010 with OSX Lion and XCode 4.6.2 Apr 15 with 
command line tools of same date.


I am working under Lazarus 1.08.  All the PPU files are where they 
should be.


Somebody from the Mac Guru crowd have any comments

Thanks,

md


___
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 maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] MacOSX Console Output

2013-05-05 Thread m...@rpzdesign.com
Inside Lazarus 1.08/FPC 2.6.2, I cannot find where the console output is 
sent

while on Mac OSX Lion.

There is a debugger output window, but there does not seem to be a 
console output window while

debugging a program.

Where does writeln( ) output go?

If I run the program from the terminal, then I see the console output, 
but not so during debugging.


Any ideas?

Cheers,

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


Re: [fpc-pascal] MacOSX Console Output

2013-05-05 Thread m...@rpzdesign.com

Martin:

Thanks for this.

Fortunately, everything I want to do on command line will happen in Linux.

All the MAC OSX stuff is GUI with Lazarus.

Who ever created Lazarus is a total GOD!.

Delphi 7 for Windows.
Lazarus/FPC for Linux and MacOSX !!!

Hell, I am even writing a replication engine for MariaDB (mysql) in 
Freepascal.


Thank you for all!

md

On 5/5/2013 3:52 PM, Martin wrote:

On 05/05/2013 22:45, m...@rpzdesign.com wrote:
Inside Lazarus 1.08/FPC 2.6.2, I cannot find where the console output 
is sent

while on Mac OSX Lion.

There is a debugger output window, but there does not seem to be a 
console output window while

debugging a program.

Where does writeln( ) output go?

If I run the program from the terminal, then I see the console 
output, but not so during debugging.


See this page. http://wiki.lazarus.freepascal.org/Debugger_Console_App

You can either redirect to a file, or to the pty of a terminal (which 
you have to open)


You can also set the pty in the global options (read the note on 0.9.31)


Unfortunately, still no one knows how to create a virtual tty on MAC. 
So it was not yet possible to add a proper way for the IDE to capture 
the output.

___
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


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread m...@rpzdesign.com

Are you saying that you are writing JNI routines in Pascal for android?

If so, can you post some of the things like the pascal header files you 
use to allow for the creation of the .so files

so that Java can call into pascal across the JNI interface.

I have 2 projects that I need Pascal talking across the JNI interface.  
1 for Mac OSX where I need pascal to call a JNI library

and another Android where I need Java to call freepascal library (NDK)

Thanks for any information you can share,

md


On 5/21/2013 12:52 PM, Felipe Monteiro de Carvalho wrote:

Oh, forget it. Someone answered in android-ndk group: I had a typo in
another JNI routine which caused the problem.

It seams that the new Android checks all JNI routines at startup.
Older ones checked the routines only when they were utilized, so would
only crash when it was utilized.



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


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread m...@rpzdesign.com

You sir,

Are a good man.

Thx for the link.

Watch out when the Intel mobile processors come along, I doubt they will 
be ARM 7 compatible.

But they may be x86!

md


On 5/22/2013 7:29 AM, Felipe Monteiro de Carvalho wrote:

Hello,

On Wed, May 22, 2013 at 1:50 PM, m...@rpzdesign.com  wrote:

Are you saying that you are writing JNI routines in Pascal for android?

Yes. And luckly it works in all devices =) I was a bit scared that I
might hit a wierd problem here involving code generation or whatever,
but ... just a normal typo in my program.


If so, can you post some of the things like the pascal header files you use
to allow for the creation of the .so files
so that Java can call into pascal across the JNI interface.

See here:

http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/bindings/android-ndk/

The file jni.pas is what you are looking for. The rest are Android NDK
headers. I think that it should work for any Java platform.

In the folder "examples" there, there is a full Android JNI example.

In lazarus/lcl/interfaces/customdrawn/* there is also a lot of JNI
code for Android which can be utilized as examples to learn how to use
JNI.



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


Re: [fpc-pascal] Re: Android JNI failing in Galaxy S4

2013-05-22 Thread m...@rpzdesign.com

Felipe:

Any comments on how you would mix C and pascal into the same binary
for JNI/Android?

I have some encryption routines in C that I need to link to Pascal and 
then get called by Java.


md

On 5/22/2013 7:29 AM, Felipe Monteiro de Carvalho wrote:

Hello,

On Wed, May 22, 2013 at 1:50 PM, m...@rpzdesign.com  wrote:

Are you saying that you are writing JNI routines in Pascal for android?

Yes. And luckly it works in all devices =) I was a bit scared that I
might hit a wierd problem here involving code generation or whatever,
but ... just a normal typo in my program.


If so, can you post some of the things like the pascal header files you use
to allow for the creation of the .so files
so that Java can call into pascal across the JNI interface.

See here:

http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/bindings/android-ndk/

The file jni.pas is what you are looking for. The rest are Android NDK
headers. I think that it should work for any Java platform.

In the folder "examples" there, there is a full Android JNI example.

In lazarus/lcl/interfaces/customdrawn/* there is also a lot of JNI
code for Android which can be utilized as examples to learn how to use
JNI.



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


[fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-22 Thread m...@rpzdesign.com

Anybody successful putting Freepascal 2.6.2 / Lazarus 1.0.8 on Fedora 18.

It seems like Fedora 18 has symbolic links which point /bin and /sbin to 
/usr/bin and /usr/sbin respectively.


/bin -> /usr/bin
/sbin -> /usr/sbin

Then the compiler chokes an error about "You must have an old compiler" 
because it can find fpc located in 2 different locations.


But what the compiler/lazarus does not know is that they are pointed to 
the same compiler using 2 different routes, one via the hard file system

and the other using a symbolic link.

Ideas on how to set up the compiler / lazarus for Fedora 18?

(I am not certain about Fedora 15,16,17 since I only used Fedora 14 and 
Fedora 18.


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


Re: [fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-22 Thread m...@rpzdesign.com

Which package did you download?  (Source package or other?)

md

On 5/22/2013 10:41 AM, Bart wrote:

I installed fpc 2.6.2 from the installscript (not from rpm) in /usr/local.
This works well.

Bart
___
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


Re: [fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-23 Thread m...@rpzdesign.com
Yes, you may have built the rpms on the platform, but where was the 
ultimate destination for the executables

after you RAN the RPM to install the program?

It seems that Fedora 18 unified /bin -> /usr->bin using symbolic links 
and so the compiler is not ready to run

on a system where it installs the binaries to /usr/bin.

So what I am saying for the lazarus/freepascal binary package installers 
is that they need to consider having
some option of changing where the installed binaries go that is 
different than /usr/bin.  Maybe /usr/local/bin?


md




On 5/23/2013 3:40 AM, Mattias Gaertner wrote:

"m...@rpzdesign.com"  hat am 22. Mai 2013 um 17:18
geschrieben:


Anybody successful putting Freepascal 2.6.2 / Lazarus 1.0.8 on Fedora 18.

I built successfully the 64bit rpms on a FC 18 64bit and had no such problems.

Mattias
___
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


Re: [fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-23 Thread m...@rpzdesign.com

Oops,

Looks like there is an internal list coded identifier that links the 
thread of emails together.


The moral of the story is to create a completely new email to start 
another discussion thread

and stay away from "Reply" button for convenience.

Sorry about the hijacking, it was not intended.

md

On 5/23/2013 8:37 AM, Reimar Grabowski wrote:

Is it just me or is this Fedora stuff hijacking the Android Galaxy S4 thread?
If it is not a problem of my mail client, PLEASE stop this sh!t.

R.
___
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] FPC to create PHP extensions for Linux

2013-06-01 Thread m...@rpzdesign.com
Anybody have an opinion about writing dynamic extensions for PHP in free 
pascal?


The samples and discussion at:

http://community.freepascal.org/bboards/message?message_id=342130&forum_id=24082

Indicates PHPToolkit, but all of the definitions inside these file are 
way out of date.


My current PHP version is 5.4.10 and the compiler directives deal with 
5.2.x at the highest.


And the API version is 2001 while the current is 20100525 and higher.

So either I have to inspect the header files in PHP to see what changes 
have been made
and then do a bunch of testing on struct sizes so I have the header 
files ported correctly.


And it also does not seem to handle 64 bit linux that well since there 
are a lot of records with

Word sizes (16 bit) but I need unsigned long int values. (Cardinal)

So if anybody has done anything recent with this on a more recent 
version of PHP, pass along

a shout out.

Thanks for any answer,

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


Re: [fpc-pascal] FPC to create PHP extensions for Linux

2013-06-02 Thread m...@rpzdesign.com

Ok:

After a night of dwelling on the problem, the easiest solution is to create
your linux dynamic libraries as a standalone separate lib.so library in 
free pascal
and then use C to create the php extension and link it to the freepascal 
library.


Trying to keep up with all of the PHP headers is a real pain in the ass 
so just

use the extension environment to wrap the Pascal library is the best way.

This is identical to the mysqli interface where the extension links in 
the libmysqlclient.so.xx library

into the php binary.

Hope this helps anyone doing this sort of thing.

md

On 6/1/2013 6:45 PM, m...@rpzdesign.com wrote:
Anybody have an opinion about writing dynamic extensions for PHP in 
free pascal?


The samples and discussion at:

http://community.freepascal.org/bboards/message?message_id=342130&forum_id=24082 



Indicates PHPToolkit, but all of the definitions inside these file are 
way out of date.


My current PHP version is 5.4.10 and the compiler directives deal with 
5.2.x at the highest.


And the API version is 2001 while the current is 20100525 and higher.

So either I have to inspect the header files in PHP to see what 
changes have been made
and then do a bunch of testing on struct sizes so I have the header 
files ported correctly.


And it also does not seem to handle 64 bit linux that well since there 
are a lot of records with

Word sizes (16 bit) but I need unsigned long int values. (Cardinal)

So if anybody has done anything recent with this on a more recent 
version of PHP, pass along

a shout out.

Thanks for any answer,

md
___
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


Re: [fpc-pascal] FPC to create PHP extensions for Linux - GOTCHA

2013-06-02 Thread m...@rpzdesign.com
For anybody that is working on getting PHP extensions built using 
freepascal,


I have some gotchas you may want to know about.

The with strategy of avoiding porting the PHP header files into pascal, 
I am building a .SO library
for linux so that my PHP binaries can link to it by using a quick and 
dirty C wrapper to

get access to the pascal library.

One of my extensions that I am building in freepascal also uses
the {$L } linker command to include some c based object files into the 
free pascal

shared library.

The trick to compiling the c based object files is to make sure that you 
build
a special compile script that will include the -fPIC compile option when 
building the object

files.

Normally, I can just run make on whatever c project and build the object 
files,
but to link those object files into a freepascal library, you must also 
make the object
files get position independent code or the linker inside 
Lazarus/freepascal goes bonkers.


Just an FYI for anybody who comes across this post in history.

md



On 6/2/2013 7:04 AM, m...@rpzdesign.com wrote:

Ok:

After a night of dwelling on the problem, the easiest solution is to 
create
your linux dynamic libraries as a standalone separate lib.so library 
in free pascal
and then use C to create the php extension and link it to the 
freepascal library.


Trying to keep up with all of the PHP headers is a real pain in the 
ass so just

use the extension environment to wrap the Pascal library is the best way.

This is identical to the mysqli interface where the extension links in 
the libmysqlclient.so.xx library

into the php binary.

Hope this helps anyone doing this sort of thing.

md

On 6/1/2013 6:45 PM, m...@rpzdesign.com wrote:
Anybody have an opinion about writing dynamic extensions for PHP in 
free pascal?


The samples and discussion at:

http://community.freepascal.org/bboards/message?message_id=342130&forum_id=24082 



Indicates PHPToolkit, but all of the definitions inside these file 
are way out of date.


My current PHP version is 5.4.10 and the compiler directives deal 
with 5.2.x at the highest.


And the API version is 2001 while the current is 20100525 and 
higher.


So either I have to inspect the header files in PHP to see what 
changes have been made
and then do a bunch of testing on struct sizes so I have the header 
files ported correctly.


And it also does not seem to handle 64 bit linux that well since 
there are a lot of records with

Word sizes (16 bit) but I need unsigned long int values. (Cardinal)

So if anybody has done anything recent with this on a more recent 
version of PHP, pass along

a shout out.

Thanks for any answer,

md
___
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 maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-10 Thread m...@rpzdesign.com

Under Linux using Lazarus 1.0.8/Fpc 2.6.2/Fedora 14 x64:

it seems like mixing Ansistrings and Pchars on certain run time 
functions is a real no-no.


I just spent HOURs, trying to see why I was not getting good program 
behavior.


Lesson #1: Never call function like Copy( pchar, start, length),

ONLY use Copy( ansistring/string, start, length)

Other functions like PosEx( ) do not generate compiler
errors but you really do NOT want a Pchar to this function,
only an ansistring/string.

Passing a Pchar gives weird, erratic behavior

Maybe the RTL library team could put compiler WARNINGS about only 
allowing for strings/ansistrings
on copy( ), posex( ), and other functions who have really no business 
taking pchar arguments.


Cheers,

md

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


Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread m...@rpzdesign.com

To Marco and Jeppe:

As for 2 examples:

res := PosEx(mypchar,'NEEDLE',35) ;

res := Copy (mypchar, 10,15) ;

What are the byte boundaries here?
Zero Based from the pointer?
1 Based from the pointer?

As far as behavior, it would throw the program in unstable land over 
time and gdb
would show worthless garbage on Backtrace with a stack that was totally 
upside down.


When I stumbled across these calls and cleaned them up to keep pchar and 
ansistring operations

clearly separate, magically, stability returned to my program.

The reason I posted this to the list is that it is my responsibility to 
the community to raise
the chatter, even though I cannot right now produce a working sample to 
reproduce the bug.


I absolutely love the combination of Lazarus 1.08/FPC 2.6.2. Awesome, 
awesome, awesome.

My productivity just went up 10x.

And we get Mac OSX targets, IOS targets, and Android NDK targets!

Cheers,

md






je...@j-software.dk

Could you maybe describe this weird, erratic behavior?

On 6/11/2013 12:58 AM, Marco van de Voort wrote:

In our previous episode, m...@rpzdesign.com said:

Passing a Pchar gives weird, erratic behavior

Please make minimal examples in a few lines, and add them to the bugtracker.
___
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


Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread m...@rpzdesign.com

Oops, those parameters for Posex were backwards:

res := PosEx('NEEDLE',mypchar,35) ;

On 6/11/2013 7:10 AM, m...@rpzdesign.com wrote:

To Marco and Jeppe:

As for 2 examples:

res := PosEx(mypchar,'NEEDLE',35) ;

res := Copy (mypchar, 10,15) ;

What are the byte boundaries here?
Zero Based from the pointer?
1 Based from the pointer?

As far as behavior, it would throw the program in unstable land over 
time and gdb
would show worthless garbage on Backtrace with a stack that was 
totally upside down.


When I stumbled across these calls and cleaned them up to keep pchar 
and ansistring operations

clearly separate, magically, stability returned to my program.

The reason I posted this to the list is that it is my responsibility 
to the community to raise
the chatter, even though I cannot right now produce a working sample 
to reproduce the bug.


I absolutely love the combination of Lazarus 1.08/FPC 2.6.2. Awesome, 
awesome, awesome.

My productivity just went up 10x.

And we get Mac OSX targets, IOS targets, and Android NDK targets!

Cheers,

md






je...@j-software.dk

Could you maybe describe this weird, erratic behavior?

On 6/11/2013 12:58 AM, Marco van de Voort wrote:

In our previous episode, m...@rpzdesign.com said:

Passing a Pchar gives weird, erratic behavior
Please make minimal examples in a few lines, and add them to the 
bugtracker.

___
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


Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread m...@rpzdesign.com

  
  
I totally understand, but I did not discover the problem until
I was well into a larger project that I could not de-construct
to try to generate a reproducible sample.

I am under a time pressure, decided to start using using LAZ/FPC
about 3 months ago,
and when I starting running the program under load, it started to
die.

So I cleaned up my string function calls, separated out the pchar
calls,
and things just magically healed themselves.

The program passes ALL of my load testing and just keeps running.

Do not ask me to reproduce it since I cannot
and I do not dispute that in a single threaded 
test application, that it works.

The problem is when you start building up a large pile of code
and then start up the high volume testing, things really show
themselves.

The problem in this particular case is the the GDB back trace on
segment fault was total garbage,
so I cannot use that to tell you where the bug is.

Trust me, I am putting my financial basis into the binary output
of the FPC compiler since I can produce a much larger quantity of
code faster
for LInux and Mac than I can with GCC/Xcode.

But for those like me, this serves as a warning to pay attention to
this aspect.

There is not some underlying instability, but I believe a certain
combination of things
causes a pointer reference that is off into la-la land.

My problems were in Copy( ) and PosEx( ), nothing more.

You guys rock!

md










On 6/11/2013 9:03 AM, Antonio Fortuny
  wrote:


  
  Hi Folks.
  
  I don't know how Jeppe is playing around but because I want to
  make sure FPC works preoperly I decided to take some time to see
  what happens
  Yhis is the code snippet I use in Win32 and Linux x86_64
  All are Lazaur 1.0.8
  
  Put the code under a TButton and send results to a TMemo:
  
  procedure TFrmMain.BtnTestClick(Sender: TObject);
  var
    P: Integer;
    str: String;
    pc: PChar;
    len: Integer;
  begin
    str := 'http://bcms.webdev.tralala.com/testudf.php?action="">';
    len := Length(str);
    P := PosEx('bcms', str, 3);
    Memo1.Lines.Add(Format('search "bcms" in %s: position %d', [str,
  P]));
    pc := nil;
    ReAllocMem(pc, len + 1);
    Move(PChar(str)^, pc^, len);
    pc[len] := #0;
    P := PosEx('bcms', pc, 3);
    Memo1.Lines.Add(Format('search "bcms" in %s: position %d', [str,
  P]));
  end;
  
  I've made the test with a PChar too
  
  TMemo.Lines shows:
  search "bcms" in http://bcms.webdev.tralala.com/testudf.php?action="">:
  position 8
  search "bcms" in http://bcms.webdev.tralala.com/testudf.php?action="">:
  position 8
  
  which, obviously looks correct. That's what I expect since more
  than 15 years (beginning with Delphi and Pos function)
  
  Enjoy,
  
  Antonio.
  -- 
  

  




   Antonio

  Fortuny
Senior Software engineer

220, avenue de la Liberté
L-4602 Niederkorn
Tel.: +352 58 00 93 - 93
www.sitasoftware.lu
  




  

  
  
  
  
  ___
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

Re: [fpc-pascal] GUI confusion

2013-09-30 Thread m...@rpzdesign.com

But how do you enable the anchor docking extension for Lazarus 1.0.12
and get some control of all the floating panels.

I personally would want all the panels to come to the front when I click 
on any panel
instead of having to click a couple of times to bring console or 
messages panel to the fore.


md


On 9/30/2013 2:07 AM, Michal Wallace wrote:



On Sep 29, 2013 8:24 AM, "Patrick" > wrote:


> I don't really like IDEs. I used gvim and I suppose it could almost 
be called an IDE as well but I mean I would rather use the shellr then 
clicking on a build button.


For what its worth, I use free pascal practically every day, but 
rarely open Lazarus.


I write most of my code in emacs, running inside a tmux session: 
http://tangentstorm.imgur.com/all/


But if I were going to make a GUI app, it would be crazy of me to 
ignore Lazarus. :)


I also use it when I want to browse and navigate through other 
people's source code. You can ctrl-click on identifiers as id they 
were hyperlinks.


Also if part of what bothers you is all the floating panels, you can 
enable the anchor docking extension and put everything into one 
window. That made a tremendous difference for me.




___
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

Re: [fpc-pascal] GUI confusion

2013-09-30 Thread m...@rpzdesign.com

Sven:

You ROCK!

md

On 9/30/2013 11:19 AM, Sven Barth wrote:

Am 30.09.2013 15:57, schrieb m...@rpzdesign.com:

But how do you enable the anchor docking extension for Lazarus 1.0.12
and get some control of all the floating panels.
Install AnchorDockingDsgn package, rebuild Lazarus and now you're able 
to dock.


Regards,
Sven


___
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

Re: [fpc-pascal] how to speed up lazarus compilation and debugging

2013-09-30 Thread m...@rpzdesign.com

Here is a suggestion that might help your compile times.

If you want superfast increases in compiling under 
linux/freepascal/lazarus,
switch your development computer to a super fast CPU and especially an 
SSD solid state disk drive.


Make sure you have no spinning disks/media in your computer.

I cannot tell you how much my compile times improved when I moved to a 
development computer

that had a solid state drive only.

Linux Fedora 14 x64 fully boots from power on in 30 seconds.  Fedora 19 
x64 fully boots to KDE in 30 seconds from power on.


My Apple Ipad Mini IOS 6 takes 30 seconds to power on from Boot. Android 
Nexus 7 tablet takes even longer.


Freepascal/Lazarus compile times are insanely short, for even huge projects.

You can rebuild the entire Lazarus IDE in about a minute, even with 
CLEAN ALL setting (not automatic).  Taking
out unwanted packaged cuts down on this time.  And my CPU is not the 
fastest offered by intel.  But the SSD

makes all the difference.

Of course, I run Windows on the same computers on SSD
drive and those Delphi 7 compile times are near instant.

Let your hardware bail you out from compile times.

Cheers,

md

On 9/30/2013 11:55 AM, Mattias Gaertner wrote:

On Mon, 30 Sep 2013 17:52:39 +0200 (CEST)
Michael Van Canneyt  wrote:



On Mon, 30 Sep 2013, Dennis Poon wrote:




On Mon, 30 Sep 2013, Dennis Poon wrote:


I came from the old delphi 5 IDE and I found the lazarus 1.0.8 /FPC 2.6.2
's compilation and debugging a lot slower than Delphi 5.
Are there any settings that I can make to speed up Lazarus?

Switch to Linux.



It is faster on Linux but still way slower than Delphi 5 on windows.

Yes. This is known and considered not an issue.

Well, it is an issue, but all proposed solutions had
drawbacks.

Mattias
___
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] $LINKLIB MSVCRT on windows/osx

2014-03-09 Thread m...@rpzdesign.com

Hey:

Has anybody got a clue how to statically link the windows c run time with
lazarus/freepascal on Windows 7/8  x32 or x64?

Looking at gdbint.pp, there are all sorts of references to {$LINKLIB 
libmsvcrt.a}


But there is only libmsvcrt.a when I install MingW 4.8.1 compiler

Since forum.lazarus.freepascal.org is no longer available, any prior 
posts about this topic are gone.


Cheers,

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

Re: [fpc-pascal] $LINKLIB MSVCRT on windows/osx

2014-03-09 Thread m...@rpzdesign.com

Oops:

That was a typo error.

First I need to link to c run time on Windows.

Then I need to link to c run time on OSX.

Cheers,

marco

On 3/9/2014 1:42 PM, m...@rpzdesign.com wrote:

Hey:

Has anybody got a clue how to statically link the windows c run time with
lazarus/freepascal on Windows 7/8  x32 or x64?

Looking at gdbint.pp, there are all sorts of references to {$LINKLIB 
libmsvcrt.a}


But there is only libmsvcrt.a when I install MingW 4.8.1 compiler

Since forum.lazarus.freepascal.org is no longer available, any prior 
posts about this topic are gone.


Cheers,

Marco


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

Re: [fpc-pascal] $LINKLIB MSVCRT on windows/osx

2014-03-09 Thread m...@rpzdesign.com

Marco:

Thanks for your response.

I am trying to use {$LINKLIB ceecodelib.a} .

But this compiled c code makes references to Windows C Runtime calls 
like _memcpy, etc.


Under linux, I was able to use {$LINKLIB c} and it picked up all the 
unresolved references for the linker.


Under Windows Win32 (On Windows 7,8, etc), I do not see any blogs or 
posts that indicate how to resolve references

like linking to the C runtime (msvcrt.dll)

Instead of manually providing a link to msvcrt.dll, I want to tell the 
linker to look for unresolved references there.


I also have to get the problem solved on OSX.

Thanks for any advice you may have,

Cheers,

md

On 3/9/2014 1:53 PM, Marco van de Voort wrote:

In our previous episode, m...@rpzdesign.com said:

Has anybody got a clue how to statically link the windows c run time with
lazarus/freepascal on Windows 7/8  x32 or x64?

No idea.
  

Looking at gdbint.pp, there are all sorts of references to {$LINKLIB
libmsvcrt.a}

But there is only libmsvcrt.a when I install MingW 4.8.1 compiler

Since forum.lazarus.freepascal.org is no longer available, any prior
posts about this topic are gone.

Those afaik are not about statically linking msvcrt, but about the gdb
C (and the C/Unix libs it depends on) needing this library to link to
the msvcrt DLL. IOW it is an import library.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



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


Re: [fpc-pascal] $LINKLIB MSVCRT on windows/osx

2014-03-09 Thread m...@rpzdesign.com

Marco:

Based on the tone of your response, I am thinking that I
am doing something stupid on windows win32?

Should I be using Microsoft compiler to build  ceecodelib.a? (Instead of 
Mingw 4.7x)


I was seeing COFF magic error for Microsoft compiler static libraries.

The amount of information I found on compiling c-code for static linking 
against freepascal has
been pretty sparse, so I guessed that I need to use a gcc compiler to 
create static linkable code for freepascal 2.6.2


A good example is inside the static library ceecodelib.a which calls: 
GetTickCount( )


My pascal code successfully links {$LINKLIB objwin32/libceecode.a}, but 
that is not the real problem.


This error shows up in the linker for freepascal as:

Error: Undefined symbol: _GetTickCount@0

So that is what I am trying to get rid of, all the unresolved references 
by telling the linker where to find the function
without having to manually put a function GetTickCount : DWORD; cdecl ; 
external name 'Kernel32.dll' ; in a pas file for every unresolved reference.


Just easier with {$LINKLIB kernel32}, except the compiler spits out:

Error: Import library not found for kernel32.  (Yikes!)

Help me Obi-Wan Kenobi, your my only hope.

md








On 3/9/2014 2:52 PM, Marco van de Voort wrote:

In our previous episode, m...@rpzdesign.com said:

Thanks for your response.

I am trying to use {$LINKLIB ceecodelib.a} .

But this compiled c code makes references to Windows C Runtime calls
like _memcpy, etc.

What is that library compiled with? I guess mingw.

You probably need various .a files from that compiler to get this working.
Preferably exactly the same version and exactly the same build, though
I guess import libs are pretty invariant.

The ones that you see in gdbint are meant to be used with a package that
contains libgdb.a and all other .a's that are dependencies from the mingw
suite these were built with.

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



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


[fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-09 Thread m...@rpzdesign.com

Now that OSX Mavericks 10.9 is running full speed, it has broken the
{$LINKLIB gcc} compiler directive.

{$LINKLIB c} still WORKS.
But {$LINKLIB gcc} does not.

The reason is that Mavericks does not use GCC any more, it is using clang,
a new compiler.

So now Freepascal users need to know how to resolve errors:

Undefined symbols for architecture i386:
"___divdi3", referenced from libmystatic.a,
"___moddi3", referenced from libmystatic.a, etc...

ANybody got ideas?

I tried {$LINKLIB clang}, it does not exist.

Thanks for any ideas,

Marco

 






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


Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-09 Thread m...@rpzdesign.com

After diving deeply into the dependency tree,

there are 2 libraries that are involved in this particular problem:

/usr/lib/libSystem.B.dylib
/usr/lib/libgcc_s.1.dylib

But I cannot figure out yet how to call up the libgcc_s.1.dylib

{$LINKLIB /usr/lib/gcc [many variations tried] }

The mystery continues

md


On 3/9/2014 11:32 PM, m...@rpzdesign.com wrote:

Now that OSX Mavericks 10.9 is running full speed, it has broken the
{$LINKLIB gcc} compiler directive.

{$LINKLIB c} still WORKS.
But {$LINKLIB gcc} does not.

The reason is that Mavericks does not use GCC any more, it is using 
clang,

a new compiler.

So now Freepascal users need to know how to resolve errors:

Undefined symbols for architecture i386:
"___divdi3", referenced from libmystatic.a,
"___moddi3", referenced from libmystatic.a, etc...

ANybody got ideas?

I tried {$LINKLIB clang}, it does not exist.

Thanks for any ideas,

Marco







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



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


Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-10 Thread m...@rpzdesign.com

Peter:

I was surprised too.  That is why I broadcast the alarm to the FPC 
community.


I am running FPC 2.6.2 - Lazarus 1.0.14

Yes, I can recompile FPC from scratch on Mavericks.
I can compile perfectly well on Mavericks too.

No, I cannot issue the {$LINKLIB gcc } command on Mavericks OSX 10.9

Have you tried the {$LINKLIB gcc } command?

Anybody else got ideas?

md


On 3/10/2014 1:03 AM, Peter Brooks wrote:

I'm a bit surprised. As it happens, just this week I compiled the fpc
compiler from scratch on Mavericks. It worked perfectly well, and is
compiling perfectly well - version 2.6.0.

I was wondering, though, whether there was any enhanced support for
features on the Intel 'Sandy-Bridge' and 'Ivy-Bridge' processors - the
i5 chips.

On 10 March 2014 05:32, m...@rpzdesign.com  wrote:

Now that OSX Mavericks 10.9 is running full speed, it has broken the
{$LINKLIB gcc} compiler directive.

{$LINKLIB c} still WORKS.
But {$LINKLIB gcc} does not.

The reason is that Mavericks does not use GCC any more, it is using clang,
a new compiler.

So now Freepascal users need to know how to resolve errors:

Undefined symbols for architecture i386:
"___divdi3", referenced from libmystatic.a,
"___moddi3", referenced from libmystatic.a, etc...

ANybody got ideas?

I tried {$LINKLIB clang}, it does not exist.

Thanks for any ideas,

Marco






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

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



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


Re: [fpc-pascal] $LINKLIB MSVCRT on windows

2014-03-10 Thread m...@rpzdesign.com

Ludo:

I wish the forum.lazarus.freepascal.org website were functional.  It is 
usually not responding most of the time.


Can you or anybody just copy the step by step instructions into an email 
and send it to me directly?


I would love to look at the step by step instructions, but that forum 
has an internet connection problem.


Funny, last night, I could look at the site for the first time in days, 
but this morning, it is not available.


Maybe it suffers denial of service attacks?

Thanks,

md

On 3/10/2014 3:15 AM, Ludo Brands wrote:

On 03/09/2014 08:36 PM, m...@rpzdesign.com wrote:

Marco:

Based on the tone of your response, I am thinking that I
am doing something stupid on windows win32?


You are on the correct path but you need to point to the mingw
libraries. They provide the stubs for msvcrt and other windows standard
libraries. Take a look at these step by step instructions on static
linking
http://forum.lazarus.freepascal.org/index.php/topic,15712.msg84781.html#msg84781
. It is about linking Sqlite but it applies to most C code.

Ludo

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



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


Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-10 Thread m...@rpzdesign.com

Jonas,

Unfortunately, your suggestion while appreciated does not work.

For example, the actual function "__divdi3" actually lives in 
/usr/lib/system/libcompiler_rt.dylib


This library does not exist on Snow Leopard. But it does exist on 
Mavericks.  (I do not have Lion/Mtn Lion available)


{$LINKLIB gcc_s} does not work -> Library NOT found by FPC compiler/linker
{$LINKLIB compiler_rt} does not work -> Library NOT found by FPC 
compiler/linker
{$LINKLIB /usr/lib/system/libcompiler_rt.dylib} does not work -> Library 
NOT found by FPC compiler/linker
{$LINKLIB /usr/lib/libgcc_s.1.dylib} does not work -> Library NOT found 
by FPC compiler/linker


I also tried using:
{$LIBRARYPATH /usr/lib/system}
{$LINKLIB compiler_rt}

So this is more challenging that I originally thought.

Must I go back to Mountain Lion to do OSX development with FPC/Lazarus?

The mystery still continues...

On 3/10/2014 3:18 AM, Jonas Maebe wrote:

On 10 Mar 2014, at 05:15, m...@rpzdesign.com wrote:


After diving deeply into the dependency tree,

there are 2 libraries that are involved in this particular problem:

/usr/lib/libSystem.B.dylib
/usr/lib/libgcc_s.1.dylib

But I cannot figure out yet how to call up the libgcc_s.1.dylib

Since the library is called libgcc_s, use {$linklib gcc_s}. You don't have to 
(and shouldn't) explicitly link in libSystem, that's already done by the 
compiler.


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



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


Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-10 Thread m...@rpzdesign.com

Peter:

I must use some form of {$LINKLIB gcc}

{$LINKLIB c} still WORKS under OSX 10.9

{$LINKLIB gcc} does not work user OSX 10.9 Mavericks.

"__divdi3" unresolved reference lives in the gcc run time library chain.

md








On 3/10/2014 11:21 AM, Peter Brooks wrote:

Why are you wanting to use gcc instead? If I wanted to do this, I'd
just replace c with a link to gcc.


On 10 March 2014 16:14, m...@rpzdesign.com  wrote:

Peter:

I was surprised too.  That is why I broadcast the alarm to the FPC
community.

I am running FPC 2.6.2 - Lazarus 1.0.14

Yes, I can recompile FPC from scratch on Mavericks.
I can compile perfectly well on Mavericks too.

No, I cannot issue the {$LINKLIB gcc } command on Mavericks OSX 10.9

Have you tried the {$LINKLIB gcc } command?

Anybody else got ideas?

md


On 3/10/2014 1:03 AM, Peter Brooks wrote:

I'm a bit surprised. As it happens, just this week I compiled the fpc
compiler from scratch on Mavericks. It worked perfectly well, and is
compiling perfectly well - version 2.6.0.

I was wondering, though, whether there was any enhanced support for
features on the Intel 'Sandy-Bridge' and 'Ivy-Bridge' processors - the
i5 chips.

On 10 March 2014 05:32, m...@rpzdesign.com  wrote:

Now that OSX Mavericks 10.9 is running full speed, it has broken the
{$LINKLIB gcc} compiler directive.

{$LINKLIB c} still WORKS.
But {$LINKLIB gcc} does not.

The reason is that Mavericks does not use GCC any more, it is using
clang,
a new compiler.

So now Freepascal users need to know how to resolve errors:

Undefined symbols for architecture i386:
"___divdi3", referenced from libmystatic.a,
"___moddi3", referenced from libmystatic.a, etc...

ANybody got ideas?

I tried {$LINKLIB clang}, it does not exist.

Thanks for any ideas,

Marco






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

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


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

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



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


Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-10 Thread m...@rpzdesign.com

Jonas:

Where in Lazarus 1.0.14 do I put in the compiler command line option?   
-WM10.9


Project Options->Compiler Options->Compilation->Compiler->Command-> 
$(CompPath) -WM10.9


And when I use this setting -WM10.9, this means that I can only execute 
the resulting binary on Mavericks and above?


But if I use -WM10.6, then this means that I am targeting for Snow 
Leopard 10.6 and above?


Thank you for breaking this down today.

Cheers,

md

On 3/10/2014 3:46 PM, Jonas Maebe wrote:


On 10 Mar 2014, at 19:07, m...@rpzdesign.com wrote:


Unfortunately, your suggestion while appreciated does not work.

For example, the actual function "__divdi3" actually lives in 
/usr/lib/system/libcompiler_rt.dylib


This library does not exist on Snow Leopard. But it does exist on 
Mavericks.  (I do not have Lion/Mtn Lion available)

It's the equivalent of libgcc for LLVM.
{$LINKLIB gcc_s} does not work -> Library NOT found by FPC 
compiler/linker
{$LINKLIB compiler_rt} does not work -> Library NOT found by FPC 
compiler/linker
{$LINKLIB /usr/lib/system/libcompiler_rt.dylib} does not work -> 
Library NOT found by FPC compiler/linker
{$LINKLIB /usr/lib/libgcc_s.1.dylib} does not work -> Library NOT 
found by FPC compiler/linker


I also tried using:
{$LIBRARYPATH /usr/lib/system}
{$LINKLIB compiler_rt}


I've looked into it. In short:
* make sure you are using FPC 2.6.2 or later.
* do *not* add any linklib statement
* use the compiler command line parameter -WM10.6 (if you want to 
target minimally Mac OS X 10.6) ... -WM10.9 (if you want to target OS 
X 10.9)




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


Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken

2014-03-11 Thread m...@rpzdesign.com

You FPC/lazarus guys ROCK.

md

On 3/10/2014 10:12 PM, Mattias Gaertner wrote:

On Mon, 10 Mar 2014 20:18:38 -0400
"m...@rpzdesign.com"  wrote:


Jonas:

Where in Lazarus 1.0.14 do I put in the compiler command line option?
-WM10.9

Project Options->Compiler Options->Compilation->Compiler->Command

No, that's the path to the compiler, no extra options.


-WM10.9

Extra options are called "custom options":
Project Options->Compiler Options->Compilation->Other->Custom options

  

And when I use this setting -WM10.9, this means that I can only execute
the resulting binary on Mavericks and above?

Yes.

  

But if I use -WM10.6, then this means that I am targeting for Snow
Leopard 10.6 and above?

Yes.

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



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


Re: [fpc-pascal] $LINKLIB MSVCRT on windows

2014-03-11 Thread m...@rpzdesign.com

The problem in tracert is at telekom.at.

Woe to the developer outside of telekom.at

md

On 3/10/2014 10:27 PM, Dmitry Boyarintsev wrote:
I'm getting 404 error some times (randomly). However, in a minute I 
can access the forum again.

It might be an issue on the hosting server.

thanks,
Dmitry


On Mon, Mar 10, 2014 at 3:21 PM, Ralf Quint <mailto:freedos...@gmail.com>> wrote:


On 3/10/2014 7:23 AM, m...@rpzdesign.com <mailto:m...@rpzdesign.com>
wrote:

Ludo:

I wish the forum.lazarus.freepascal.org
<http://forum.lazarus.freepascal.org> website were functional.
It is usually not responding most of the time.

Must be an issue on your side, I can access it, at any time I have
tried in the last few weeks, just perfectly fine...

Ralf

---
This email is free from viruses and malware because avast!
Antivirus protection is active.
http://www.avast.com


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




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


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

Re: [fpc-pascal] Linking object file

2014-03-19 Thread m...@rpzdesign.com

Darius:

I just went through this and it is fresh in my mind, but with 32 bit code.

I used CodeBlocks with MingGW to compile the c source code to a static 
library with an mylib.A suffix.


I am pretty sure you cannot use MSVC to compile the c code.

Then use the {$LINKLIB path/mylib.a} directive to link.

You do not need to use individual object files since many times there 
are many that are combined into a single static library.


When you use codeblocks, you will need to make an adjustment to produce 
64 bit binary.


It is just easier to stay with 32 bit if you can.

Let us know how it turns out in 64 bit {$LINKLIB }

Cheers,

md


On 3/19/2014 6:49 PM, Darius Blaszyk wrote:


Hi,

I was wondering if it's possible to link FPC object files by using the 
$Link directive? At least I have troubles in getting this to work and 
therefore I'm asking here. Please consider the minimal example I have 
attached to this email.


When linking the object file that implements the test_proc procedure I 
get the following compiler output:


Hint: Start of reading config file 
C:\lazarus\fpc\2.6.2\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file 
C:\lazarus\fpc\2.6.2\bin\x86_64-win64\fpc.cfg

Free Pascal Compiler version 2.6.2 [2014/02/28] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling test.pp
Linking test.exe
test.pp(8,1) Error: Undefined symbol: TEST_INT_TEST_PROC
test.pp(8,1) Fatal: There were 1 errors compiling module, stopping

What is needed in the test_impl.pas file so the linker can find the 
implemented function? Do I need to create a library and export the 
function perhaps?


Regards, Darius Blaszyk



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


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

[fpc-pascal] Lazarus better than delphi

2014-03-20 Thread m...@rpzdesign.com

I have been using Delphi 7 forever.

I evaluated Delphi xe5 Update 2.

Today, I use Lazarus 1.2 and FPC 2.6.2.

Lazarus/FPC is just better than Delphi.

All development on Mac/Windows is now with Lazarus.

You FPC/Lazarus guys ROCK.

Best wishes for 2014.

md

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


[fpc-pascal] fppoll/epoll examples/documentation

2014-03-22 Thread m...@rpzdesign.com
This may seem crazy, but I cannot find any documentation or examples on 
fppoll( ) and the events member of TFdPoll structure.


ALso, there is a epoll demo at forum.lazarus.*freepascal*.org
But I cannot ever reach that site from USA.

Anybody know about more documentation on fppoll( ) or epoll( )?

md

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

Re: [fpc-pascal] fppoll/epoll examples/documentation

2014-03-22 Thread m...@rpzdesign.com

Oops,

I will just use man pages from linux, that should get me the info I need.

I do not need pascal specific examples.

md

On 3/22/2014 8:43 PM, m...@rpzdesign.com wrote:
This may seem crazy, but I cannot find any documentation or examples 
on fppoll( ) and the events member of TFdPoll structure.


ALso, there is a epoll demo at forum.lazarus.*freepascal*.org
But I cannot ever reach that site from USA.

Anybody know about more documentation on fppoll( ) or epoll( )?

md



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


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

[fpc-pascal] Lazarus List

2014-04-06 Thread m...@rpzdesign.com

Hello Anybody:

I am on the Freepascal list, but I cannot subscribe to the lazarus list: 
*lists*.*lazarus*.freepascal.org/?

since I cannot get to http://www.lazarus.freepascal.org

I can of course reach http://freepascal.org.

Can one of the lazarus list managers contact via email directly for some 
offline subscription

to the list.

Cheers,

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

[fpc-pascal] lazarus not reachable

2014-04-06 Thread m...@rpzdesign.com

Help:

Would somebody from the USA and someone from Europe please run a tracert 
on their connection to: lazarus.freepascal.org.


I am not able to reach anything lazarus but I can get freepascal.

I want to ask a question in the lazarus list and surf the lazarus forums 
but I cannot.


Thanks,

Marco

Here are 2 tracert (trace routes) for lazarus and freepascal.

C:\Users\md>tracert lazarus.freepascal.org

Tracing route to lazarus.freepascal.org [80.123.225.56]
over a maximum of 30 hops:

  1 6 ms 1 ms<1 ms  192.168.7.1
  2 1 ms<1 ms<1 ms  192.168.6.1
  335 ms24 ms16 ms cable-mac1.faptnyal-ar4003.nyroc.rr.com 
[66.66.72.1]
  411 ms11 ms12 ms 
gig5-1.faptnyal-rtr002.wny.northeast.rr.com [24.93.8.34]
  516 ms17 ms66 ms rdc-72-230-153-12.wny.east.twcable.com 
[72.230.153.12]
  643 ms31 ms31 ms rdc-72-230-153-243.wny.east.twcable.com 
[72.230.153.243]

  730 ms31 ms30 ms  be45.cr0.chi10.tbone.rr.com [107.14.19.106]
  8 *   41 ms30 ms  ae4.pr1.chi10.tbone.rr.com [66.109.1.66]
  931 ms28 ms30 ms  chi-bb1-link.telia.net [213.248.76.97]
 1040 ms40 ms40 ms  nyk-bb1-link.telia.net [80.91.247.16]
 11   151 ms   179 ms   150 ms  ffm-bb1-link.telia.net [80.91.250.202]
 12   162 ms   164 ms   165 ms  prag-bb1-link.telia.net [213.155.133.51]
 13   157 ms   155 ms   155 ms  win-b4-link.telia.net [213.155.137.221]
 14   187 ms   188 ms   189 ms 
telekomaustria-ic-138452-win-b4.c.telia.net [213.248.96.2]
 15   185 ms   191 ms   186 ms  AUX10-IIX10.highway.telekom.at 
[195.3.70.121]

 16   174 ms   177 ms   179 ms  AUX3-LIX2.highway.telekom.at [195.3.68.170]
 17   159 ms   158 ms   162 ms  80.120.208.116
 18 *** Request timed out.
 19 ** 80.120.208.116  reports: Destination host 
unreachable.


Trace complete.

(LAZARUS IS NOT REACHABLE!)

C:\Users\md>tracert freepascal.org

Tracing route to freepascal.org [81.82.199.218]
over a maximum of 30 hops:

  1 8 ms 1 ms 1 ms  192.168.7.1
  2 2 ms 2 ms 2 ms  192.168.6.1
  348 ms22 ms34 ms cable-mac1.faptnyal-ar4003.nyroc.rr.com 
[66.66.72.1]
  415 ms12 ms11 ms 
gig5-1.faptnyal-rtr002.wny.northeast.rr.com [24.93.8.34]
  517 ms56 ms28 ms rdc-72-230-153-12.wny.east.twcable.com 
[72.230.153.12]
  633 ms34 ms31 ms rdc-72-230-153-243.wny.east.twcable.com 
[72.230.153.243]

  734 ms43 ms38 ms  be25.cr0.chi10.tbone.rr.com [107.14.19.28]
  840 ms30 ms31 ms  ae4.pr1.chi10.tbone.rr.com [66.109.1.66]
  929 ms31 ms31 ms  chi-bb1-link.telia.net [213.248.76.97]
 1045 ms91 ms41 ms  nyk-bb1-link.telia.net [62.115.137.30]
 11   138 ms   181 ms   150 ms  prs-bb1-link.telia.net [80.91.253.121]
 12   138 ms   139 ms   139 ms  brx-b2-link.telia.net [213.155.136.233]
 13   166 ms   140 ms   142 ms  telenet-ic-300448-brx-b2.c.telia.net 
[80.239.132.218]
 14   141 ms   143 ms   142 ms  dD5E0FD1E.access.telenet.be 
[213.224.253.30]

 15 *** Request timed out.
 16   136 ms   131 ms   133 ms  dD5E0C605.access.telenet.be [213.224.198.5]
 17   139 ms   140 ms   138 ms  d5152C7DA.static.telenet.be [81.82.199.218]
 18   136 ms   137 ms   141 ms  d5152C7DA.static.telenet.be [81.82.199.218]

Trace complete.

(FREE PASCAL SUCCESS)


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


Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread m...@rpzdesign.com

Jim:

Are you able to web surf to the lazarus.freepascal.org web site?


On 4/6/2014 3:07 PM, Jim Leonard wrote:

Chicago, IL, USA:

Tracing route to lazarus.freepascal.org [80.123.225.56] over a maximum 
of 30 hops:


  1 *** Request timed out.
  211 ms 9 ms18 ms  dynamic-76-73-171-41.knology.net 
[76.73.171.41]

  319 ms 8 ms10 ms  76-73-170-92.knology.net [76.73.170.92]
  413 ms10 ms12 ms xe-11-2-1.edge1.Chicago2.Level3.net 
[4.71.248.245]
  5   127 ms   126 ms   134 ms vl-3610-ve-234.ebr2.Chicago2.Level3.net 
[4.69.158.230]
  6   125 ms   134 ms   126 ms ae-6-6.ebr2.Washington12.Level3.net 
[4.69.148.145]
  7   137 ms   128 ms   127 ms ae-45-45.ebr2.Washington1.Level3.net 
[4.69.143.221]
  8   127 ms   128 ms   133 ms  ae-44-44.ebr2.Paris1.Level3.net 
[4.69.137.61]
  9   125 ms   137 ms   129 ms ae-47-47.ebr1.Frankfurt1.Level3.net 
[4.69.143.141]
 10   151 ms   128 ms   127 ms ae-81-81.csw3.Frankfurt1.Level3.net 
[4.69.140.10]
 11   126 ms   127 ms   136 ms ae-83-83.ebr3.Frankfurt1.Level3.net 
[4.69.163.9]
 12   125 ms   124 ms   127 ms  ae-1-12.bar1.Vienna1.Level3.net 
[4.69.153.145]
 13   180 ms   134 ms   128 ms  ae-0-11.bar2.Vienna1.Level3.net 
[4.69.153.150]

 14   144 ms   142 ms   148 ms  212.73.203.138
 15   158 ms   150 ms   153 ms  195.3.118.29
 16   142 ms   144 ms   153 ms  GRAZBC10-AUX10.highway.telekom.at 
[195.3.68.50]

 17   146 ms   150 ms   144 ms  80.120.208.116
 18 *** Request timed out.
 19 ** 80.120.208.116  reports: Destination host 
unreachable.




On 4/6/2014 1:37 PM, m...@rpzdesign.com wrote:

Help:

Would somebody from the USA and someone from Europe please run a tracert
on their connection to: lazarus.freepascal.org.

I am not able to reach anything lazarus but I can get freepascal.

I want to ask a question in the lazarus list and surf the lazarus forums
but I cannot.

Thanks,

Marco

Here are 2 tracert (trace routes) for lazarus and freepascal.

C:\Users\md>tracert lazarus.freepascal.org

Tracing route to lazarus.freepascal.org [80.123.225.56]
over a maximum of 30 hops:

   1 6 ms 1 ms<1 ms  192.168.7.1
   2 1 ms<1 ms<1 ms  192.168.6.1
   335 ms24 ms16 ms cable-mac1.faptnyal-ar4003.nyroc.rr.com
[66.66.72.1]
   411 ms11 ms12 ms
gig5-1.faptnyal-rtr002.wny.northeast.rr.com [24.93.8.34]
   516 ms17 ms66 ms rdc-72-230-153-12.wny.east.twcable.com
[72.230.153.12]
   643 ms31 ms31 ms rdc-72-230-153-243.wny.east.twcable.com
[72.230.153.243]
   730 ms31 ms30 ms  be45.cr0.chi10.tbone.rr.com
[107.14.19.106]
   8 *   41 ms30 ms  ae4.pr1.chi10.tbone.rr.com 
[66.109.1.66]

   931 ms28 ms30 ms  chi-bb1-link.telia.net [213.248.76.97]
  1040 ms40 ms40 ms  nyk-bb1-link.telia.net [80.91.247.16]
  11   151 ms   179 ms   150 ms  ffm-bb1-link.telia.net [80.91.250.202]
  12   162 ms   164 ms   165 ms  prag-bb1-link.telia.net 
[213.155.133.51]

  13   157 ms   155 ms   155 ms  win-b4-link.telia.net [213.155.137.221]
  14   187 ms   188 ms   189 ms
telekomaustria-ic-138452-win-b4.c.telia.net [213.248.96.2]
  15   185 ms   191 ms   186 ms  AUX10-IIX10.highway.telekom.at
[195.3.70.121]
  16   174 ms   177 ms   179 ms  AUX3-LIX2.highway.telekom.at
[195.3.68.170]
  17   159 ms   158 ms   162 ms  80.120.208.116
  18 *** Request timed out.
  19 ** 80.120.208.116  reports: Destination host
unreachable.

Trace complete.

(LAZARUS IS NOT REACHABLE!)

C:\Users\md>tracert freepascal.org

Tracing route to freepascal.org [81.82.199.218]
over a maximum of 30 hops:

   1 8 ms 1 ms 1 ms  192.168.7.1
   2 2 ms 2 ms 2 ms  192.168.6.1
   348 ms22 ms34 ms cable-mac1.faptnyal-ar4003.nyroc.rr.com
[66.66.72.1]
   415 ms12 ms11 ms
gig5-1.faptnyal-rtr002.wny.northeast.rr.com [24.93.8.34]
   517 ms56 ms28 ms rdc-72-230-153-12.wny.east.twcable.com
[72.230.153.12]
   633 ms34 ms31 ms rdc-72-230-153-243.wny.east.twcable.com
[72.230.153.243]
   734 ms43 ms38 ms  be25.cr0.chi10.tbone.rr.com 
[107.14.19.28]
   840 ms30 ms31 ms  ae4.pr1.chi10.tbone.rr.com 
[66.109.1.66]

   929 ms31 ms31 ms  chi-bb1-link.telia.net [213.248.76.97]
  1045 ms91 ms41 ms  nyk-bb1-link.telia.net [62.115.137.30]
  11   138 ms   181 ms   150 ms  prs-bb1-link.telia.net [80.91.253.121]
  12   138 ms   139 ms   139 ms  brx-b2-link.telia.net [213.155.136.233]
  13   166 ms   140 ms   142 ms telenet-ic-300448-brx-b2.c.telia.net
[80.239.132.218]
  14   141 ms   143 ms   142 ms  dD5E0FD1E.access.telenet.be
[213.224.253.30]
  15 *** Request timed out.
  16   136 ms   131 ms   133 ms  dD5E0C605.access.telenet.be
[213.224.198.5]
  17   139 ms   140 ms   138 ms  d5152C7DA.static.telenet.be
[81.82.199.218]
  18   136 ms   

Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread m...@rpzdesign.com

Martin:

Can you translate what "lower MPU" means?

md


From london / I can open the page in a browser.

Can you try, if you can access it with a lower MPU ? IIRC a very long 
time ago, some of the servers or ronnections had an issue / No idea if 
that is still an issue at all


C:\Users\martin>tracert lazarus.freepascal.org

Tracing route to lazarus.freepascal.org [80.123.225.56]
over a maximum of 30 hops:

  193 ms77 ms99 ms   [192.168.1.254]
  2 *** Request timed out.
  331 ms29 ms23 ms  027808f8.bb.sky.com [2.120.8.248]
  424 ms25 ms25 ms  ae51.edge6.London1.Level3.net 
[212.113.9.53]
  546 ms46 ms46 ms vl-3613-ve-237.csw2.London1.Level3.net 
[4.69.166.82]
  645 ms46 ms45 ms  ae-57-222.ebr2.London1.Level3.net 
[4.69.153.133]
  745 ms44 ms45 ms ae-23-23.ebr2.Frankfurt1.Level3.net 
[4.69.148.194]
  844 ms45 ms45 ms ae-72-72.csw2.Frankfurt1.Level3.net 
[4.69.140.22]
  944 ms53 ms45 ms ae-73-73.ebr3.Frankfurt1.Level3.net 
[4.69.163.5]
 1045 ms44 ms45 ms  ae-1-12.bar1.Vienna1.Level3.net 
[4.69.153.145]
 1162 ms   106 ms45 ms  ae-0-11.bar2.Vienna1.Level3.net 
[4.69.153.150]

 1244 ms44 ms53 ms  212.73.203.138
 1345 ms45 ms45 ms  AUX10-IIX11.highway.telekom.at 
[195.3.70.217]

 1448 ms48 ms49 ms  195.3.118.22
 1547 ms47 ms48 ms  80.120.208.116
 16 *** Request timed out.
 17 ** 80.120.208.116  reports: Destination host 
unreachable.


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



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


Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread m...@rpzdesign.com

Well,

I cannot subscribe to the lazarus mailing list and I can not enter the 
forums at forums.lazarus.freepascal.org
or www.lazarus.freepascal.org because I can not make an http connection 
to either.


Just keep timing out.

FYI for list managers...

Cheers all,

marco



On 4/6/2014 10:22 PM, waldo kitty wrote:

On 4/6/2014 5:40 PM, m...@rpzdesign.com wrote:

Jim:

Are you able to web surf to the lazarus.freepascal.org web site?


yes, i can and i do not normally visit that site...

FWIW: icmp may not be being allowed by the destination site or the 
router saying that the destination host is unreachable... that last 
address (below), when searched in google, shows as the first link 
named "Remote Access Control" but does not respond, AFAICT, to http 
connections... at least not from my current address...


central NC, USA

Tracing route to lazarus.freepascal.org [80.123.225.56]
over a maximum of 30 hops:

  1<1 ms<1 ms<1 ms  www.xxx.yyy.zzz
  216 ms16 ms16 ms  71.30.80.1
  316 ms15 ms21 ms  40.130.34.250
  420 ms20 ms18 ms  173.190.207.34
  524 ms19 ms19 ms  173.190.207.14
  619 ms20 ms19 ms  4.71.124.53
  720 ms21 ms45 ms  4.69.200.217
  8   207 ms   278 ms   212 ms  4.69.200.206
  9   303 ms   422 ms   334 ms  4.69.200.214
 10   136 ms   129 ms   130 ms  4.69.134.134
 11   141 ms   160 ms   133 ms  4.69.134.149
 12   142 ms   151 ms   129 ms  4.69.137.53
 13   130 ms   128 ms   128 ms  4.69.143.137
 14   128 ms   128 ms   127 ms  4.69.140.14
 15   127 ms   128 ms   127 ms  4.69.163.13
 16   127 ms   127 ms   127 ms  4.69.153.145
 17   128 ms   135 ms   128 ms  4.69.153.150
 18   127 ms   127 ms   126 ms  212.73.203.138
 19   136 ms   136 ms   136 ms  195.3.68.137
 20   152 ms   149 ms   149 ms  195.3.118.22
 21   147 ms   149 ms   147 ms  80.120.208.116
 22 *** Request timed out.
 23 ** 80.120.208.116  reports: Destination host 
unreachable.


Trace complete.



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


Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread m...@rpzdesign.com

Ralf:

I am very sorry to bother you.

I will not make another request for information on this topic

Each time I started to try to pursue the matter earlier, I got some 
light responses, but never

was in a position to fully eliminate the problem.

Today, I tried to gather more information using comparative trace routes 
to solve the problem.


Several other users have been very kind to share their trace routes 
failing but are still getting through using HTTP.


If this problem follows me to another internet cafe or public wi-fi, I 
will then try outside of my ISP area

or even leave the region to run a connection test.

All of my computers and tablets here fail, so is likely some silly ISP 
issue,

like C#//.NET developers at my ISP who filter all pascal traffic!!!

Thank you everyone for your responses and help.

marco

On 4/6/2014 10:54 PM, Ralf Quint wrote:

On 4/6/2014 7:52 PM, m...@rpzdesign.com wrote:

Well,

I cannot subscribe to the lazarus mailing list and I can not enter 
the forums at forums.lazarus.freepascal.org
or www.lazarus.freepascal.org because I can not make an http 
connection to either.


Just keep timing out.

FYI for list managers...

Well, you have posted this now several times and several times it has 
been shown that you are the only one who has such problems. Could you 
possibly be bothered to start looking at something that could be wrong 
on YOUR end?:-(


Ralf



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


Re: [fpc-pascal] lazarus not reachable

2014-04-07 Thread m...@rpzdesign.com


On 4/7/2014 3:44 AM, Lukasz Sokol wrote:

On 07/04/14 04:17, m...@rpzdesign.com wrote:

On 4/6/2014 10:54 PM, Ralf Quint wrote:

On 4/6/2014 7:52 PM, m...@rpzdesign.com
wrote:

Well,

I cannot subscribe to the lazarus mailing list and I can not
enter the forums at forums.lazarus.freepascal.org or
www.lazarus.freepascal.org because I can not make an http
connection to either.

Just keep timing out.

FYI for list managers...


Well, you have posted this now several times and several times it
has been shown that you are the only one who has such problems.
Could you possibly be bothered to start looking at something that
could be wrong on YOUR end?:-(

Ralf


(rearranged, to Marco: pls avoid top-posting... unless you have a good reason)


Ralf:

I am very sorry to bother you.

I will not make another request for information on this topic

Each time I started to try to pursue the matter earlier, I got some
light responses, but never was in a position to fully eliminate the
problem.

Today, I tried to gather more information using comparative trace
routes to solve the problem.

Several other users have been very kind to share their trace routes
failing but are still getting through using HTTP.

If this problem follows me to another internet cafe or public wi-fi,
I will then try outside of my ISP area or even leave the region to
run a connection test.

All of my computers and tablets here fail, so is likely some silly
ISP issue, like C#//.NET developers at my ISP who filter all pascal
traffic!!!

Thank you everyone for your responses and help.

marco

Hi Marco,

usually a site like http://www.downforeveryoneorjustme.com/ helps
(short url : http://isup.me )

(btw http://www.downforeveryoneorjustme.com/lazarus.freepascal.org says
site is up as of 7/4/14 8:40 BST/London time).

-L.

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



That is an excellent link.
This is a great community.
Thank you all for sound advice.

I will also stop top posting, per lukas request.

marco

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


Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-23 Thread m...@rpzdesign.com
When trying to install lazarus 1.2.2 on Linux Fedora 14:

fpc-2.6.4-1.x86_64.rpm does not install.

Shows error:  "lazarus-1.2.0-0.x86_64 requires fpc = 2.6.2-130317"

I think the dependency tree inside the fpc and fpc-src rpms are crossed.
 They somehow need fpc 2.6.2?

Cheers,

md

On 4/23/2014 10:34 AM, Mattias Gaertner wrote:
> The Lazarus team is glad to announce the release of Lazarus 1.2.2.
> 
> This release was built with fpc 2.6.4. The previous release 1.2 was
> built with 2.6.2. 
> 
> Here is the list of changes for Lazarus and Free Pascal:
> http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.2_.28Merged.29
> http://wiki.lazarus.freepascal.org/User_Changes_2.6.4
> 
> On Windows the installer now allows 2 independent installations.
> http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Installation_of_multiple_Lazarus
> 
> The release is available for download on SourceForge:
> http://sourceforge.net/projects/lazarus/files/
> 
> Choose your CPU, OS, distro and then the "Lazarus 1.2.2" directory.
> Windows x64 users: please use the 32 bit installer if possible. See
> http://wiki.lazarus.freepascal.org/Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29
> for more details.
> 
> Minimum requirements:
> Windows:   98
> FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit
> Mac OS X:  10.5 for Intel cpus, 10.4 for PowerPC, LCL only 32bit,
> non LCL apps can be 64bit
> 
> The svn tag is
> http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2_2
> 
> For people who are blocked by SF, the Lazarus releases from SourceForge
> are mirrored at: 
> ftp://freepascal.dfmk.hu/pub/lazarus/releases/
> and later at (after some time for synchronization)
> http://michael-ep3.physik.uni-halle.de/Lazarus/releases/
> and
> http://mirrors.iwi.me/lazarus/
> 
> 
> Mattias
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-24 Thread m...@rpzdesign.com
Mattias:

Just wanted to say "Thank you" for all of your contributions to this
project.

md

On 4/24/2014 3:42 AM, Mattias Gaertner wrote:
> On Wed, 23 Apr 2014 17:42:13 -0400
> "m...@rpzdesign.com"  wrote:
> 
>> When trying to install lazarus 1.2.2 on Linux Fedora 14:
>>
>> fpc-2.6.4-1.x86_64.rpm does not install.
>>
>> Shows error:  "lazarus-1.2.0-0.x86_64 requires fpc = 2.6.2-130317"
> 
> Try installing all three, fpc, fpc-src and lazarus with one command or
> uninstall the old three before installing the new three.
>  
>> I think the dependency tree inside the fpc and fpc-src rpms are crossed.
>>  They somehow need fpc 2.6.2?
> 
> Here they install without error.
> 
> Mattias
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
Hello:

Is a string[30] declaration under Linux thread safe?

I am not worried about atomicity, just that the memory for a string[30]
if thread safe.

For UTF8String, it is not.

I have 2 threads which are comparing/changing memory and I do not
want criticalsections wrapping the memory accesses for speed reasons.

Type
  Class TTest(TObject)
  public
nflag : integer ;
sflag : string[30]
  end;


Gui Thread

gtest := TTest.Create ;

Thread #1 - Constantly changing values

while true do
begin
 gtest.nflag := Random($) ;
 gtest.sflag := inttostr(gtest.nflag) ;
end;

Thread #2 - Constantly Comparing values

While true do
begin

  if gtest.nflag = 777888 then
  begin
break ;
  end;

  //Test string matching instead of integer matching
  if gtest.sflag = '123456' then
  begin
LaunchSpaceShuttle(gtest) ;
  end;

end;


Thanks for any replies,

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


Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
Just as I suspected.

So every time a new value is assigned to a string[30] variable, memory
is allocated and changed by the compiler, so the internal string pointer
changes as well.

And the only recourse is critical sections for memory access.

Correct?

CHeers,

marco


On 6/4/2014 1:16 PM, Michael Van Canneyt wrote:
> 
> 
> On Wed, 4 Jun 2014, m...@rpzdesign.com wrote:
> 
>> Hello:
>>
>> Is a string[30] declaration under Linux thread safe?
> 
> No.
> 
> Michael.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
I guess what I was really asking is:

Is there a way to treat an array of chars as a string.

I like the string handling patterns of freepascal but I want
the memory stability of a static array of chars
so I can be used in multi-thread operations without
a lot a critical section considerations.

Cheers,

marco



On 6/4/2014 1:16 PM, Michael Van Canneyt wrote:
> 
> 
> On Wed, 4 Jun 2014, m...@rpzdesign.com wrote:
> 
>> Hello:
>>
>> Is a string[30] declaration under Linux thread safe?
> 
> No.
> 
> Michael.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
For anybody who has followed this thread, there is some disagreement
over the thread safety of shortstrings.  And in this case, a shortstring
with a clearly defined maximum length.

Some have clearly said string[30] is NOT thread safe.

Rich indicated below he feels they ARE SAFE.

Hmmm.  Time for DOUBLE jeopardy.

Alex Trebeck says, "I am the son of Ansistring but I don't move around
much. My pointer is me and I am my pointer."

Answer:  What is a shortstring in Freepascal?

I am going to err on the side of caution and take Michael Van Canneyt's
version and implement it that way.

I have to implement the same thread code in C++ a little later, so there
are no shortstrings in C++, just QStrings. (oops, yeah, I use Qt also)

Cheers,

Marco


On 6/4/2014 2:13 PM, Saunders, Rich wrote:
> On 2014-06-04 13:22, m...@rpzdesign.com wrote:
>> I guess what I was really asking is:
>>
>> Is there a way to treat an array of chars as a string.
>>
>> I like the string handling patterns of freepascal but I want
>> the memory stability of a static array of chars
>> so I can be used in multi-thread operations without
>> a lot a critical section considerations.
> 
> Short strings (those declared with a defined length) are not as dynamic
> as you fear. They should stay in place while you change their values.
> 
> The String type (declared without defined length) is the one that is
> dynamic and reference counted.
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
I thought I had publicly declared what I wanted to do.

Here is the example code again for ease of reference:

Type
  Class TTest(TObject)
  public
nflag : integer ;
sflag : string[30]
  end;


Gui Thread

gtest := TTest.Create ;

Thread #1 - Constantly changing values

while true do
begin
 gtest.nflag := Random($) ;
 gtest.sflag := inttostr(gtest.nflag) ;
end;

Thread #2 - Constantly Comparing values

While true do
begin

  if gtest.nflag = 777888 then
  begin
break ;
  end;

  //Test string matching instead of integer matching
  if gtest.sflag = '123456' then
  begin
LaunchSpaceShuttle(gtest) ;
  end;

end;

Will this code be thread safe in terms of the gtest.sflag = '123456'
line never throw an exception because it is referring to stable memory
that is always less than 31 bytes.

Cheers,

marco



On 6/4/2014 3:27 PM, Mattias Gaertner wrote:
> On Wed, 04 Jun 2014 15:03:31 -0400
> "Saunders, Rich"  wrote:
> 
>> [...]
>> Whether static variables are more or less thread safe is for you to 
>> decide since you know what you are doing with them. I don't think either 
>> short strings or Strings are inherently more or less thread safe. It 
>> depends on what you do with them.
> 
> No data is "thread safe". Only code can be thread safe.
> 
> Mattias
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] How to contribute code to Free Pascal

2014-06-04 Thread m...@rpzdesign.com
Hello:

I would like to contribute code to the Free pascal community.

Specifically, it is a CodeBlocks C++ project to compile using MinGW C++
compiler to create a static libraries from www.polarssl.org SSL C-code
for usage by Lazarus/Freepascal on Windows.

It is a little tricky to get all the C code compiled and linked and
ready for usage by Freepascal.

Maybe this reference project could save someone else the headache of
getting the libraries built and ready.

Where would something that is not a specific Pascal source code but a
important reference project actually go?

The code is not polished, nor can I stop what I am doing right now to
get it polished for the public.  But it would definitely change some
freepascal users minds if the Project/code/libraries were readily available.

Cheers,

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


[fpc-pascal] Linux RecvMsg( ) Calls Missing

2014-06-15 Thread m...@rpzdesign.com
I was looking through the RTL and found that cfprecvmsg( ) socket calls
into the C Run Time library were commented out.

Also commented out cfpsendmsg( ) calls.

While recvfrom( ) is available, it does not include the PTKINFO options
necessary to determine a destination IP address on a multi interface
Linux server.

Nor does it offer the ability to set the Source Address when sending via
sendto( )

Anybody have a quick suggestion or must I spend the afternoon
implementing cfprecvmsg( ) and cfpsendmsg( ) calls.

Thanks,

Marco

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


Re: [fpc-pascal] Linux RecvMsg( ) Calls Missing

2014-06-15 Thread m...@rpzdesign.com
Ok, I am getting closer.

Under the unixsockets in RTL, it has all the declarations necessary.

Anybody have an idea on how to use unixsockets in a uses clause
so the compiler will not trigger:

Can't find unit 'unixsockets' used by .pas

Or should I just add the RTL to my project path?

Thanks for any responses,

marco



On 6/15/2014 6:08 PM, m...@rpzdesign.com wrote:
> I was looking through the RTL and found that cfprecvmsg( ) socket calls
> into the C Run Time library were commented out.
> 
> Also commented out cfpsendmsg( ) calls.
> 
> While recvfrom( ) is available, it does not include the PTKINFO options
> necessary to determine a destination IP address on a multi interface
> Linux server.
> 
> Nor does it offer the ability to set the Source Address when sending via
> sendto( )
> 
> Anybody have a quick suggestion or must I spend the afternoon
> implementing cfprecvmsg( ) and cfpsendmsg( ) calls.
> 
> Thanks,
> 
> Marco
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linux RecvMsg( ) Calls Missing

2014-06-15 Thread m...@rpzdesign.com
See solution below:

> On 6/15/2014 6:08 PM, m...@rpzdesign.com wrote:
>> I was looking through the RTL and found that cfprecvmsg( ) socket calls
>> into the C Run Time library were commented out.
>>
>> Also commented out cfpsendmsg( ) calls.
>>
>> While recvfrom( ) is available, it does not include the PTKINFO options
>> necessary to determine a destination IP address on a multi interface
>> Linux server.
>>
>> Nor does it offer the ability to set the Source Address when sending via
>> sendto( )
>>
>> Anybody have a quick suggestion or must I spend the afternoon
>> implementing cfprecvmsg( ) and cfpsendmsg( ) calls.
>>
>> Thanks,
>>
>> Marco
>>
>> ___
>> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
> 
On 6/15/2014 6:26 PM, m...@rpzdesign.com wrote:> Ok, I am getting closer.
>
> Under the unixsockets in RTL, it has all the declarations necessary.
>
> Anybody have an idea on how to use unixsockets in a uses clause
> so the compiler will not trigger:
>
> Can't find unit 'unixsockets' used by .pas
>
> Or should I just add the RTL to my project path?
>
> Thanks for any responses,
>
> marco
>
>
>

It borrows heavily from RTL, but is now confirmed to
work on Linux 2.6.x +

Sorry to pepper the list...

Here is the solution:

A copied unixsockets file usable in fpc 2.6.4/lazarus 1.2.x

unit fpunixsocket;


{$mode objfpc}{$H+}

{$packrecords C}

interface

uses
  sockets,
  cTypes,
  BaseUnix;

type

  Piovec = ^Tiovec;
  Tiovec = record
iov_base : pointer;
iov_len : size_t;
  end;

  Pmsghdr = ^Tmsghdr;
  Tmsghdr = record
 msg_name : pointer; //8
 msg_namelen : socklen_t; //4
 msg_iov : piovec; //8
 msg_iovlen : size_t; //8
 msg_control : pbyte ; //8
 msg_controllen : size_t; //8
 msg_flags : cInt; //4
  end;

  Pcmsghdr = ^Tcmsghdr;
  Tcmsghdr = record
cmsg_len   : size_t;
cmsg_level : cInt;
cmsg_type  : cInt;
  end;

  Ppktinfo = ^Tpktinfo;
  Tpktinfo = record
ipi_ifindex : longint;
ipi_spec_dst : in_addr;
ipi_addr : in_addr;
  end;


  function fpsendmsg(__fd: cInt; __message: pmsghdr; __flags: cInt):
ssize_t; cdecl; external 'c' name 'sendmsg';
  function fprecvmsg(__fd: cInt; __message: pmsghdr; __flags: cInt):
ssize_t; cdecl; external 'c' name 'recvmsg';
  function __cmsg_nxthdr(__mhdr:Pmsghdr;
__cmsg:Pcmsghdr):Pcmsghdr;cdecl;external 'c' name '__cmsg_nxthdr';

  function CMSG_FIRSTHDR(mhdr: Pmsghdr): Pcmsghdr;
  function CMSG_NXTHDR(mhdr: Pmsghdr; cmsg: Pcmsghdr): Pcmsghdr;
  function CMSG_ALIGN(len: size_t): size_t;
  function CMSG_SPACE(len: size_t): size_t;
  function CMSG_LEN(len: size_t): size_t;
  function CMSG_DATA(cmsg: Pcmsghdr): Pointer;

implementation

function CMSG_FIRSTHDR(mhdr: Pmsghdr): Pcmsghdr;
begin
  if mhdr^.msg_controllen >= SizeOf(Tcmsghdr) then
Result:=Pointer(mhdr^.msg_control)
  else
Result:=nil;
end;

function CMSG_NXTHDR(mhdr: Pmsghdr; cmsg: Pcmsghdr): Pcmsghdr;
begin
   Result:=__cmsg_nxthdr(mhdr, cmsg);
end;

function CMSG_ALIGN(len: size_t): size_t;
begin
  Result:=(len+SizeOf(size_t)-1) and (not(SizeOf(size_t)-1));
end;

function CMSG_SPACE(len: size_t): size_t;
begin
  Result:=CMSG_ALIGN(len)+CMSG_ALIGN(SizeOf(Tcmsghdr));
end;

function CMSG_LEN(len: size_t): size_t;
begin
  Result:=CMSG_ALIGN(SizeOf(Tcmsghdr))+len;
end;

function CMSG_DATA(cmsg: Pcmsghdr): Pointer;
begin
  Result:=Pointer(  cuint64(cmsg) + SizeOf(Tcmsghdr));
end;


end.

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