Re: [fpc-pascal] Main thread wait and CheckSynchronize

2010-05-17 Thread Brad Campbell
Jonas Maebe wrote: On 17 May 2010, at 16:00, Brad Campbell wrote: I wish there was a way for a thread to asynchronously notify the main thread there is a Synchronize() pending. On Linux I can insert an fd() for a pipe into the gtk event loop and poke data into the pipe from the thread

Re: [fpc-pascal] Main thread wait and CheckSynchronize

2010-05-17 Thread Brad Campbell
Michael Van Canneyt wrote: Hello, I think that what you did is the only right solution. Synchronizing threads is tricky, and the default mechanism is meant for GUI apps where the main thread is the GUI thread. I wish there was a way for a thread to asynchronously notify the main thread the

Re: [fpc-pascal] Cross compiling: "from linux to Darwin or Mac OS X"

2010-03-28 Thread Brad Campbell
Torsten Bonde Christiansen wrote: I do already own a legit Mac mini so I have not problem compiling my code for Mac OS X. But the mini is not my primary machine and is actually only meant for testing puposes, so I wanted to create a setup on my primary PC (64-bit linux) that, using a script, ca

Re: [fpc-pascal] One experience with the unit serial

2009-11-19 Thread Brad Campbell
Holger Bruns wrote: At first, there must be a queue for incoming data despite I ruled out a queue with an inbuffer with the length 1. No, you did not rule out a queue at all, you are simply reading from it 1 byte at a time. I'm absolutely positive you can do what you want to do by simply us

Re: [fpc-pascal] One experience with the unit serial

2009-11-19 Thread Brad Campbell
Holger Bruns wrote: Hi, one more question regarding the unit serial. I use the following function to get one single byte form a serial port, which has been open before with seropen: function getdata(inhandle: tserialhandle; var recdata: char): longint; begin fillchar(inbuffer, sizeof(inbuffe

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Brad Campbell
Holger Bruns wrote: The real sad thing is, that one cannot produce software for Linux, based on the restricted free pascal compiler. I am really disappointed. That's an interesting assertion. I use serial.pp on i386 Linux, x86_64 Linux, PPC OSX & Intel OSX flawlessly. I use synaser on Win32.

Re: [fpc-pascal] Case insensitive FindFirst and friends

2009-05-18 Thread Brad Campbell
Jonas Maebe wrote: On 18 May 2009, at 08:18, Brad Campbell wrote: In this application I'm populating a stringlist with a list of files in a directory with a specific extension, but of course I've just realised that the case of that extension is tripping me up. Is there a bet

[fpc-pascal] Case insensitive FindFirst and friends

2009-05-17 Thread Brad Campbell
G'day all, I've got a little application I'm working on that is compiled for Darwin, Linux and Win32 and I've bumped up against case sensitivity in FindFirst and friends. In this application I'm populating a stringlist with a list of files in a directory with a specific extension, but of cour

Re: [fpc-pascal] Re: Hello World for Darwin ?

2008-12-15 Thread Brad Campbell
Skybuck Flying wrote: I suspect cross compiling not functional. Not unless you installed the cross compiler, no. I did find a free pascal compiler for Mac OS X so I ll give that one a try ;) The native compilers work fine on both Intel and PPC Macs. I believe building *nix cross compilers

Re: [fpc-pascal] Bug in rtl/baseunix on OSX - Abort with illegal instruction

2008-10-16 Thread Brad Campbell
Jonas Maebe wrote: On 16 Oct 2008, at 06:17, Brad Campbell wrote: fpmkfifo aborts with an illegal instruction on OSX. It's the same problem as this one: http://bugs.freepascal.org/view.php?id=11705 (except that it's for fpmkfifo instead of for fpchown). I've fixed it in svn

Re: [fpc-pascal] simpleipc

2008-10-16 Thread Brad Campbell
Luca Olivetti wrote: En/na Brad Campbell ha escrit: What I ended up doing was creating a lockfile and having the server hold an exclusive lock on it. If the server starts and can get an exclusive lock then it know's it is the first process running, and to delete the ipc pipe if it hangs

Re: [fpc-pascal] simpleipc

2008-10-16 Thread Brad Campbell
Michael Van Canneyt wrote: On Thu, 16 Oct 2008, Brad Campbell wrote: G'day all, I've been having a play with simpleipc.pp for trying to do cross-platform single instance detection. Ordinarily it behaves perfectly, but I just noticed on Linux that it all comes crashing down if

[fpc-pascal] Bug in rtl/baseunix on OSX - Abort with illegal instruction

2008-10-15 Thread Brad Campbell
G'day all, fpmkfifo aborts with an illegal instruction on OSX. macppc:~ user$ fpc testfifo.pas Free Pascal Compiler version 2.2.3 [2008/06/14] for powerpc Copyright (c) 1993-2008 by Florian Klaempfl Target OS: Darwin for PowerPC Compiling testfifo.pas Assembling fifotest Linking testfifo 8 lines

[fpc-pascal] simpleipc

2008-10-15 Thread Brad Campbell
G'day all, I've been having a play with simpleipc.pp for trying to do cross-platform single instance detection. Ordinarily it behaves perfectly, but I just noticed on Linux that it all comes crashing down if the server application crashes without removing the pipe. I then have to manually re

Re: [fpc-pascal] OT: Buy a Mac to develop for MacOS? Which one?

2008-10-11 Thread Brad Campbell
Lukas Gradl wrote: Hi! Having a customer request to port an app to MacOS I have to think about some test platform. As I was never interested in MacOS this is virgin territory to me. So perhaps some of the Mac-users here can help me out a bit: I still want to use my current machines as them ma

Re: [fpc-pascal] Smartlinking while cross compiling

2008-10-08 Thread Brad Campbell
Jonas Maebe wrote: On 08 Oct 2008, at 09:15, Brad Campbell wrote: I'm cross compiling from i386-linux to i386-darwin/powerpc-darwin/i386-win32. I can't seem to create smartlinkable libraries for anything other than i386-linux and so all my cross compiled files are sudden

Re: [fpc-pascal] Smartlinking while cross compiling

2008-10-08 Thread Brad Campbell
Brad Campbell wrote: G'day all, I'm cross compiling from i386-linux to Yet again I fail to provide any useful information. This is using the svn FIXES_2_2 Branch as of the 1/10/2008. I'm trying trunk now to see if I'm doing something dumb. -- Dolphins are so intellige

[fpc-pascal] Smartlinking while cross compiling

2008-10-08 Thread Brad Campbell
G'day all, I'm cross compiling from i386-linux to i386-darwin/powerpc-darwin/i386-win32. I can't seem to create smartlinkable libraries for anything other than i386-linux and so all my cross compiled files are suddenly huge by comparison. I thought I had this working. Everything is compiled w

Re: [fpc-pascal] [RFC] Modification to packages/paszlib/src/zipper.pp

2008-09-30 Thread Brad Campbell
Michael Van Canneyt wrote: Implemented as proposed (rev. 11833). I updated TUnZipper so it works with TZipFileEntry as well. It is now also possible to provide the input through streams. (size is needed, so not every stream can be used). Absolutely fantastic. The stream option also saves m

Re: [fpc-pascal] Ansistring not being freed on Halt(1)

2008-09-29 Thread Brad Campbell
Graeme Geldenhuys wrote: On Mon, Sep 29, 2008 at 11:19 AM, Brad Campbell <[EMAIL PROTECTED]> wrote: I'm chasing an issue with a program I have that is leaving an Ansistring unfreed on exit. It exists cleanly without using halt(), but this is the the only way I've managed

[fpc-pascal] Ansistring not being freed on Halt(1)

2008-09-29 Thread Brad Campbell
I'm chasing an issue with a program I have that is leaving an Ansistring unfreed on exit. It exists cleanly without using halt(), but this is the the only way I've managed to reproduce it. Should Halt() leave memory unfreed? It is only reproducible if I use ExtractFileName or ExtractFileExt.. (

[fpc-pascal] [RFC] Modification to packages/paszlib/src/zipper.pp

2008-09-28 Thread Brad Campbell
With reference to this thread.. http://www.nabble.com/FPC-Zip-library-td15145102.html and the resulting bug entry.. http://bugs.freepascal.org/view.php?id=10787 I had a similar requirement, so I went and had a crack at patching zipper.pas. It does precisely what _I_ want it to do, but it's not

Re: [fpc-pascal] Debugging a darwin cross-compiler

2008-09-25 Thread Brad Campbell
Brad Campbell wrote: G'day all, Still on the trail of the serial unit issue. Think I have it working (it's working perfectly on OSX PPC and all my variants of Linux) but I can't seem to generate valid OSX Intel binaries. I've got a working cross compile setup where

Re: [fpc-pascal] Debugging a darwin cross-compiler

2008-09-24 Thread Brad Campbell
Jonas Maebe wrote: On 24 Sep 2008, at 14:51, Brad Campbell wrote: Still on the trail of the serial unit issue. Think I have it working (it's working perfectly on OSX PPC and all my variants of Linux) but I can't seem to generate valid OSX Intel binaries. I've got a workin

[fpc-pascal] Debugging a darwin cross-compiler

2008-09-24 Thread Brad Campbell
G'day all, Still on the trail of the serial unit issue. Think I have it working (it's working perfectly on OSX PPC and all my variants of Linux) but I can't seem to generate valid OSX Intel binaries. I've got a working cross compile setup where I can generate fully functional linux/win32/OSX-P

Re: [fpc-pascal] Serial port access on Darwin PPC

2008-09-23 Thread Brad Campbell
Jonas Maebe wrote: On 23 Sep 2008, at 14:24, Brad Campbell wrote: tios.c_cflag is used to obtain the baudrate constant, but it's not then cleared before or'ing the other constants into it. Strangely enough this works on linux x86, but breaks badly in MacOS PPC. Uninitialised

Re: [fpc-pascal] Serial port access on Darwin PPC

2008-09-23 Thread Brad Campbell
Jonas Maebe wrote: On 23 Sep 2008, at 12:51, Brad Campbell wrote: Can any Mac people tell me why FHandle := fpOpen(Port, O_RDWR or O_NOCTTY); (Where FHandle is a longint and port is '/dev/tty.usbserial-A400379A') .. just locks up waiting ? No, I can't tell you why this ha

[fpc-pascal] Serial port access on Darwin PPC

2008-09-23 Thread Brad Campbell
G'day all, Can any Mac people tell me why FHandle := fpOpen(Port, O_RDWR or O_NOCTTY); (Where FHandle is a longint and port is '/dev/tty.usbserial-A400379A') .. just locks up waiting ? (I've tried it on two Mac PPC machines now, both cross-compiled from my linux x86 install, and compiled nativ

Re: [fpc-pascal] Need three things

2007-08-12 Thread Brad Campbell
JK Smith at Grid-Sky wrote: Ok, one more: 4) I miss array slice syntax (str:= s[2..7];) from the Stony Brook M2 days. So much more concise than Copy().; One thing I *really* love about Python. No, really! Brad -- "Human beings, who are almost unique in having the ability to learn from the exp

Re: [fpc-pascal] postgres3 async notify mem leak

2007-06-30 Thread Brad Campbell
Brad Campbell wrote: G'day all, I'm using Postgres 8.1 and have async notifies working nicely based on select(). The problem is each time I get a notify I leak memory. I've commented out the PQfreemem call and find exactly the same size leak (tested over 10,000 notifies). I a

[fpc-pascal] postgres3 async notify mem leak

2007-06-30 Thread Brad Campbell
G'day all, I'm using Postgres 8.1 and have async notifies working nicely based on select(). The problem is each time I get a notify I leak memory. I've commented out the PQfreemem call and find exactly the same size leak (tested over 10,000 notifies). I assume from that I'm doing something very