mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
make objc2 compatibility code compile on mingw
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29674 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
901b7b6975
commit
d6a9545848
5 changed files with 97 additions and 9 deletions
|
@ -1,12 +1,17 @@
|
||||||
|
|
||||||
#ifdef STRICT_MACOS_X
|
#ifdef STRICT_MACOS_X
|
||||||
# define OBJC_NONPORTABLE __attribute__((error("Function not supported by the Apple runtime")))
|
# define OBJC_NONPORTABLE __attribute__((error("Function not supported by the Apple runtime")))
|
||||||
#else
|
#else
|
||||||
# define OBJC_NONPORTABLE
|
# define OBJC_NONPORTABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__DEPRECATE_DIRECT_ACCESS) || defined(__OBJC_LEGACY_GNU_MODE__) || defined(__OBJC_RUNTIME_INTERNAL__)
|
#if !defined(__DEPRECATE_DIRECT_ACCESS) || defined(__OBJC_LEGACY_GNU_MODE__) || defined(__OBJC_RUNTIME_INTERNAL__)
|
||||||
# define OBJC_DEPRECATED
|
# define OBJC_DEPRECATED
|
||||||
#else
|
#else
|
||||||
# define OBJC_DEPRECATED __attribute__((deprecated))
|
# if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR >= 1))
|
||||||
|
# define OBJC_DEPRECATED __attribute__((deprecated))
|
||||||
|
# else
|
||||||
|
# define OBJC_DEPRECATED
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
67
Source/ObjectiveC2/Makefile.preamble
Normal file
67
Source/ObjectiveC2/Makefile.preamble
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
#
|
||||||
|
# Makefile.preamble
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# Author: Scott Christley <scottc@net-community.com>
|
||||||
|
#
|
||||||
|
# This file is part of the GNUstep Base Library.
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# Library General Public License for more details.
|
||||||
|
#
|
||||||
|
# If you are interested in a warranty or support for this source code,
|
||||||
|
# contact Scott Christley at scottc@net-community.com
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; see the file COPYING.LIB.
|
||||||
|
# If not, write to the Free Software Foundation,
|
||||||
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Makefile.preamble
|
||||||
|
#
|
||||||
|
# Project specific makefile variables
|
||||||
|
#
|
||||||
|
# Do not put any Makefile rules in this file, instead they should
|
||||||
|
# be put into Makefile.postamble.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Flags dealing with compiling and linking
|
||||||
|
#
|
||||||
|
|
||||||
|
# Additional flags to pass to the preprocessor
|
||||||
|
ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) -Wall
|
||||||
|
|
||||||
|
# Additional flags to pass to the Objective-C compiler
|
||||||
|
#ADDITIONAL_OBJCFLAGS =
|
||||||
|
|
||||||
|
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
|
||||||
|
ADDITIONAL_OBJCFLAGS += -DBUILD_libgnustep_base_DLL=1
|
||||||
|
endif
|
||||||
|
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
|
||||||
|
ADDITIONAL_OBJCFLAGS += -DBUILD_libgnustep_base_DLL=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Additional flags to pass to the C compiler
|
||||||
|
ADDITIONAL_CFLAGS =
|
||||||
|
|
||||||
|
# Additional include directories the compiler should search
|
||||||
|
# FIXME - the -I../ is for GSPrivate.h
|
||||||
|
ADDITIONAL_INCLUDE_DIRS = -I../../Headers/Additions \
|
||||||
|
-I../$(GNUSTEP_TARGET_DIR) -I../
|
||||||
|
|
||||||
|
ifeq ($(FOUNDATION_LIB),gnu)
|
||||||
|
ADDITIONAL_INCLUDE_DIRS += -I../../Headers
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Additional LDFLAGS to pass to the linker
|
||||||
|
ADDITIONAL_LDFLAGS =
|
|
@ -200,6 +200,16 @@ struct StackBlockClass {
|
||||||
const char *types;
|
const char *types;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
/* 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
|
/* Copy a block to the heap if it's still on the stack or
|
||||||
* increments its retain count.
|
* increments its retain count.
|
||||||
|
|
|
@ -520,7 +520,7 @@ class_setIvarLayout(Class cls, const char *layout)
|
||||||
memcpy(cls->ivars, list, listsize);
|
memcpy(cls->ivars, list, listsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((deprecated))
|
OBJC_DEPRECATED
|
||||||
Class
|
Class
|
||||||
class_setSuperclass(Class cls, Class newSuper)
|
class_setSuperclass(Class cls, Class newSuper)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,10 +3,16 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef ERROR_UNSUPPORTED_RUNTIME_FUNCTIONS
|
#ifdef ERROR_UNSUPPORTED_RUNTIME_FUNCTIONS
|
||||||
# define OBJC_GNU_RUNTIME_UNSUPPORTED(x) \
|
# define OBJC_GNU_RUNTIME_UNSUPPORTED(x) \
|
||||||
__attribute__((error(x " not supported by the GNU runtime")))
|
__attribute__((error(x " not supported by the GNU runtime")))
|
||||||
#else
|
#else
|
||||||
# define OBJC_GNU_RUNTIME_UNSUPPORTED(x)
|
# define OBJC_GNU_RUNTIME_UNSUPPORTED(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR >= 1))
|
||||||
|
# define OBJC_DEPRECATED __attribute__((deprecated))
|
||||||
|
#else
|
||||||
|
# define OBJC_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Undo GNUstep substitutions
|
// Undo GNUstep substitutions
|
||||||
|
@ -153,7 +159,7 @@ BOOL class_respondsToSelector(Class cls, SEL sel);
|
||||||
|
|
||||||
void class_setIvarLayout(Class cls, const char *layout);
|
void class_setIvarLayout(Class cls, const char *layout);
|
||||||
|
|
||||||
__attribute__((deprecated))
|
OBJC_DEPRECATED
|
||||||
Class class_setSuperclass(Class cls, Class newSuper);
|
Class class_setSuperclass(Class cls, Class newSuper);
|
||||||
|
|
||||||
void class_setVersion(Class theClass, int version);
|
void class_setVersion(Class theClass, int version);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue