mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
mingw block fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32540 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
46cf25ebed
commit
ee7872e6fd
2 changed files with 4 additions and 23 deletions
|
@ -808,19 +808,12 @@ GSGarbageCollectorLog(char *msg, GC_word arg)
|
|||
* Semi-private function in libobjc2 that initialises the classes used for
|
||||
* blocks.
|
||||
*/
|
||||
#ifndef __MINGW__
|
||||
BOOL
|
||||
objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
||||
#endif
|
||||
|
||||
+ (void)load
|
||||
+ (void) load
|
||||
{
|
||||
#ifndef __MINGW__
|
||||
/* When NSObject is loaded, register it as the superclass of the block
|
||||
* classes */
|
||||
if (objc_create_block_classes_as_subclasses_of)
|
||||
objc_create_block_classes_as_subclasses_of(self);
|
||||
#endif
|
||||
objc_create_block_classes_as_subclasses_of(self);
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
|
|
|
@ -200,16 +200,6 @@ struct StackBlockClass {
|
|||
const char *types;
|
||||
};
|
||||
|
||||
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||
/* FIXME ... evil hack ... declare symbol to avoid linker error on windows
|
||||
* where the compiler/linker doesn't support a weak reference.
|
||||
* This obviously breaks the code below...
|
||||
*/
|
||||
# if (__GNUC__ <= 3)
|
||||
void *_NSConcreteStackBlock;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Copy a block to the heap if it's still on the stack or
|
||||
* increments its retain count.
|
||||
|
@ -219,8 +209,7 @@ _Block_copy(void *src)
|
|||
{
|
||||
struct StackBlockClass *self = src;
|
||||
struct StackBlockClass *ret = self;
|
||||
|
||||
extern void _NSConcreteStackBlock __attribute__((weak));
|
||||
extern void _NSConcreteStackBlock;
|
||||
|
||||
// If the block is Global, there's no need to copy it on the heap.
|
||||
if (self->isa == &_NSConcreteStackBlock
|
||||
|
@ -244,8 +233,7 @@ void
|
|||
_Block_release(void *src)
|
||||
{
|
||||
struct StackBlockClass *self = src;
|
||||
|
||||
extern void _NSConcreteStackBlock __attribute__((weak));
|
||||
extern void _NSConcreteStackBlock;
|
||||
|
||||
if (self->isa == &_NSConcreteStackBlock
|
||||
// A Global block doesn't need to be released
|
||||
|
|
Loading…
Reference in a new issue