Commit Graph

5 Commits

Author SHA1 Message Date
Jonas Maebe
eeb8c747d5 --- Merging r42499 into '.':
U    packages/univint/fpmake.pp
...
--- Recording mergeinfo for merge of r42499 into '.':
 U   .
--- Merging r42500 into '.':
U    packages/cocoaint/fpmake.pp
...
--- Recording mergeinfo for merge of r42500 into '.':
 G   .
--- Merging r42548 into '.':
G    packages/univint/src/AUComponent.pas
G    packages/univint/src/AudioUnitProperties.pas
--- Recording mergeinfo for merge of r42548 into '.':
 G   .
--- Merging r43684 into '.':
U    compiler/msg/errore.msg
...
--- Recording mergeinfo for merge of r43684 into '.':
 G   .
--- Merging r43687 into '.':
G    packages/univint/src/AudioComponents.pas
U    packages/univint/src/AudioServices.pas
--- Recording mergeinfo for merge of r43687 into '.':
 G   .

git-svn-id: branches/fixes_3_2@44035 -
2020-01-26 12:48:42 +00:00
Jonas Maebe
5d4837329b * changed {$modeswitch blocks} to {$modeswitch cblocks} to avoid confusion
with the Pascal meaning of the term "block"

git-svn-id: trunk@29594 -
2015-02-01 15:50:06 +00:00
Jonas Maebe
dc172ef55b * disabled blocks tests for Darwin/ppc(64), as the blocks runtime is only
only shipped with Mac OS X 10.6 and later (and the last version supporting
    ppc was 10.5)

git-svn-id: trunk@29522 -
2015-01-22 19:56:34 +00:00
Jonas Maebe
c730e16031 * changed the syntax for block procvars from "xxx is block" to
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
    uses for anonymous function references. The "cdecl;" indicates that this
    is for the C-variant of such references, which is what blocks are

git-svn-id: branches/blocks@28233 -
2014-07-18 09:15:29 +00:00
Jonas Maebe
bd09b88a5b + support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
o blocks are implemented as a variation of procedure variables
   o declaration of a block variable: "test: procedure(c: char) is block;"
     (C equivalent: (void)(^test)(char c) )
   o the compiler automatically converts procedures/functions whose address
     is passed to a block parameter or assigned to a block variable into
     a "block". This consists of
    1) generating a block descriptor (containing the size of the "block
       literal" (see below) and the signature of the invocation function
       encoded as an Objective-C selector)
    2) generating a wrapper function around the original funcion (with C
       calling convention), that has an extra first hidden parameter
       (marked as vo_is_parentfp in the compiler) whose type is a pointer
       to the describing "block literal"
    3) generating the "block literal", which contains a pointer to an
       external variable indicating whether this block captures context or
       not, some flags (see compiler/blockutl.get_block_literal_flags for
       info), a pointer to the wrapper function and a pointer to the
       descriptor. In the future, it will also contain captured variables.
   o right now, only global procedures/functions can be converted to blocks
     (because they don't require state capturing). The next steps are (Object
     Pascal) methods (not Objective-C methods, because Objective-C method
     procvars don't exist) and finally nested functions
   o on Mac OS X, the functionality will only work on Mac OS X 10.7 and later,
     because we have to use the so-called "ABI.2010.3.16" to ensure that
     our blocks aren't called as variadic functions by the runtime (which
     came out after the Mac OS X 10.6 release)
   o while the currently implemented functionality does not require any
     library support at all, there's no use enabling it on other platforms
     because unless it has been confirmed to work with a blocks runtime,
     there's no point in using blocks (they're just somewhat bulky procvars
     right now). Enabling it on other platforms (in combination with the
     GNUStep Objective-C run time), should simply be a matter of adding
     the right {$linklib xxx} statement to rtl/inc/blockrtl.pp file, adding
     that file to Makefile.fpc for that platform and adding that platform
     to the compiler/systems.systems_blocks_supported set

git-svn-id: branches/blocks@28232 -
2014-07-18 09:15:22 +00:00