diff --git a/Source/ObjectiveC2/Availability.h b/Source/ObjectiveC2/Availability.h index 81d4cf952..c8fe3677e 100644 --- a/Source/ObjectiveC2/Availability.h +++ b/Source/ObjectiveC2/Availability.h @@ -1,12 +1,17 @@ #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 -# define OBJC_NONPORTABLE +# define OBJC_NONPORTABLE #endif #if !defined(__DEPRECATE_DIRECT_ACCESS) || defined(__OBJC_LEGACY_GNU_MODE__) || defined(__OBJC_RUNTIME_INTERNAL__) -# define OBJC_DEPRECATED +# define OBJC_DEPRECATED #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 + diff --git a/Source/ObjectiveC2/Makefile.preamble b/Source/ObjectiveC2/Makefile.preamble new file mode 100644 index 000000000..319838aff --- /dev/null +++ b/Source/ObjectiveC2/Makefile.preamble @@ -0,0 +1,67 @@ +# +# Makefile.preamble +# +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# Author: Scott Christley +# +# 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 = diff --git a/Source/ObjectiveC2/blocks_runtime.m b/Source/ObjectiveC2/blocks_runtime.m index b6671a951..25e0151da 100644 --- a/Source/ObjectiveC2/blocks_runtime.m +++ b/Source/ObjectiveC2/blocks_runtime.m @@ -200,6 +200,16 @@ struct StackBlockClass { 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 * increments its retain count. diff --git a/Source/ObjectiveC2/runtime.c b/Source/ObjectiveC2/runtime.c index 016faf9d7..bb096bba1 100644 --- a/Source/ObjectiveC2/runtime.c +++ b/Source/ObjectiveC2/runtime.c @@ -520,7 +520,7 @@ class_setIvarLayout(Class cls, const char *layout) memcpy(cls->ivars, list, listsize); } -__attribute__((deprecated)) +OBJC_DEPRECATED Class class_setSuperclass(Class cls, Class newSuper) { diff --git a/Source/ObjectiveC2/runtime.h b/Source/ObjectiveC2/runtime.h index 695f5a40a..63b783dac 100644 --- a/Source/ObjectiveC2/runtime.h +++ b/Source/ObjectiveC2/runtime.h @@ -3,10 +3,16 @@ #include #ifdef ERROR_UNSUPPORTED_RUNTIME_FUNCTIONS -# define OBJC_GNU_RUNTIME_UNSUPPORTED(x) \ - __attribute__((error(x " not supported by the GNU runtime"))) +# define OBJC_GNU_RUNTIME_UNSUPPORTED(x) \ + __attribute__((error(x " not supported by the GNU runtime"))) #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 // Undo GNUstep substitutions @@ -153,7 +159,7 @@ BOOL class_respondsToSelector(Class cls, SEL sel); void class_setIvarLayout(Class cls, const char *layout); -__attribute__((deprecated)) +OBJC_DEPRECATED Class class_setSuperclass(Class cls, Class newSuper); void class_setVersion(Class theClass, int version);