Re: [fpc-devel] FPC 3.0.0 class property default
Am 27.10.2015 12:30 schrieb "Mark Morgan Lloyd" < markmll.fpc-de...@telemetry.co.uk>: > What is the correct syntax, and how far back is FPC compatible with it? A property must have at least a read or a write accessor if it isn't inherited, so you need to add at least one of them. Since that is the standard form for properties FPC supports this since the "default" keyword for properties is supported. Regards, Sven ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] FPC 3.0.0 class property default
On 27.10.2015 12:24, Mark Morgan Lloyd wrote: Up to and including 2.6.4, this works: TRoundRobin= CLASS(TObject) .. PUBLIC .. (*$IFDEF HAS_TRUE YIELD *) PROPERTY HasTrueYield: BOOLEAN DEFAULT TRUE; (*$ELSE *) PROPERTY HasTrueYield: BOOLEAN DEFAULT FALSE; (*$ENDIF*) .. END; However using 3.0.0 rc1 I get roundrobin.pas(80,55) Fatal: Syntax error, "READ" expected but "identifier DEFAULT" found It looks as though this was coded for a facility that wasn't actually used, but that the intention was to convert a compile-time conditional into something that could be incorporated into an ordinary boolean expression. What is the correct syntax, and how far back is FPC compatible with it? IMO * PROPERTY HasTrueYield DEFAULT TRUE; ** *** Ondrej ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] FPC 3.0.0 class property default
On 27.10.2015 12:32, Ondrej Pokorny wrote: * PROPERTY HasTrueYield DEFAULT TRUE; ** * But then there has tobe a property to override. What do you use PROPERTY HasTrueYield: BOOLEAN DEFAULT TRUE; for? In 2.6.4 you cannot read this property. Is it useful for RTTI? Ondrej ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[fpc-devel] FPC 3.0.0 class property default
Up to and including 2.6.4, this works: TRoundRobin= CLASS(TObject) .. PUBLIC .. (*$IFDEF HAS_TRUE YIELD *) PROPERTY HasTrueYield: BOOLEAN DEFAULT TRUE; (*$ELSE *) PROPERTY HasTrueYield: BOOLEAN DEFAULT FALSE; (*$ENDIF*) .. END; However using 3.0.0 rc1 I get roundrobin.pas(80,55) Fatal: Syntax error, "READ" expected but "identifier DEFAULT" found It looks as though this was coded for a facility that wasn't actually used, but that the intention was to convert a compile-time conditional into something that could be incorporated into an ordinary boolean expression. What is the correct syntax, and how far back is FPC compatible with it? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] Exception problems in FPC 3.0.0
On 10/27/2015 4:29 PM, Sergio Flores wrote: Yury, I think you're right, I'm using the precompiled binary that indeed seems to been compiled in soft-fpu mode, so that would explain everything, as OpenGL is probably triggering hard fpu exceptions that are not being caught. I tried your asm function, however adding it makes the app crash at startup. I added it to initialization of my OpenGLES unit, Seems that just having the function laying around, even without calling it, causes the crash. Checking the android log, it says the following: E/AndroidRuntime(10684): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "TERRA_OPENGLES_$$_LOADOPENGL" referenced by "libterra.so"... LoadOpenGL() is the only pascal function that is contained in this unit (it just loads the opengles library dynamically and assigns function pointers). For some reason, adding the assembler function to this unit makes this function disappear, what causes this very weird behaviour? Full unit code here: http://pastebin.com/h2gCcikd Commenting both the function and the function call makes the game startup again without crashing (albeit still crashes whevener a float exception happens) I've provided wrong code. Try this one: procedure VFP_MaskExceptions; assembler; nostackframe; asm .long 0xeef10a10// fmrx r0,fpscr bic r0,r0,#0x1F00 .long 0xeee10a10// fmxr fpscr,r0 end; Probably recompiling FPC with hard float support would be the best solution, however compiling FPC in Windows is a frustrating game of trial and errors. I had written a .bat file that I used with 2.6.2, but it no longer works in 3.0.0. Once I have some free time I guess I will have to try discovering whats problem. Or if anyone has 3.0.1 compiled with hard-floats and can provide a download link, i would be thankful. Building a cross compiler is a trivial task even on Windows. Read here ho to do that: http://wiki.freepascal.org/Android Yury. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] Exception problems in FPC 3.0.0
Yury, I think you're right, I'm using the precompiled binary that indeed seems to been compiled in soft-fpu mode, so that would explain everything, as OpenGL is probably triggering hard fpu exceptions that are not being caught. I tried your asm function, however adding it makes the app crash at startup. I added it to initialization of my OpenGLES unit, Seems that just having the function laying around, even without calling it, causes the crash. Checking the android log, it says the following: E/AndroidRuntime(10684): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "TERRA_OPENGLES_$$_LOADOPENGL" referenced by "libterra.so"... LoadOpenGL() is the only pascal function that is contained in this unit (it just loads the opengles library dynamically and assigns function pointers). For some reason, adding the assembler function to this unit makes this function disappear, what causes this very weird behaviour? Full unit code here: http://pastebin.com/h2gCcikd Commenting both the function and the function call makes the game startup again without crashing (albeit still crashes whevener a float exception happens) Probably recompiling FPC with hard float support would be the best solution, however compiling FPC in Windows is a frustrating game of trial and errors. I had written a .bat file that I used with 2.6.2, but it no longer works in 3.0.0. Once I have some free time I guess I will have to try discovering whats problem. Or if anyone has 3.0.1 compiled with hard-floats and can provide a download link, i would be thankful. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel