summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-10 09:56:40 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-10 09:56:40 +0000
commit01eb761e3088d72508d2190978ad488cbb75c321 (patch)
treeaecc8134138b797706917530127f1a76bf0da100
parentdd3eae968c619f0c174e985e7f40d963cc2b601d (diff)
downloadppe42-gcc-01eb761e3088d72508d2190978ad488cbb75c321.tar.gz
ppe42-gcc-01eb761e3088d72508d2190978ad488cbb75c321.zip
* libobjc/objc/deprecated: New directory.
* libobjc/objc/deprecated/README: New file. * libobjc/objc/README: New file. * libobjc/objc/typedstream.h: Moved into objc/deprecated/typedstream.h; objc/typedstream.h replaced with a placeholder including the file from the deprecated/ directory. * libobjc/objc/deprecated/objc-unexpected-exception.h: New file with the definition of _objc_unexpected_exception. * libobjc/objc/objc-api.h: Include deprecated/objc-unexcepted-exception.h instead of defining _objc_unexpected_exception. * libobjc/objc/deprecated/Object.h: New file with the deprecated Object methods in a 'Deprecated' category. * libobjc/objc/Object.h Include deprecated/Object.h instead of defining the deprecated methods. * libobjc/Object.m: Moved deprecated methods into 'Deprecated' category. * libobjc/objc-private: New directory. * libobjc/objc-private/README: New file. * libobjc/Makefile.in (OBJC_DEPRECATED_H): New variable. (install-headers): Create installation directory for OBJC_DEPRECATED_H headers, and install them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164153 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libobjc/ChangeLog27
-rw-r--r--libobjc/Makefile.in13
-rw-r--r--libobjc/Object.m7
-rw-r--r--libobjc/objc-private/README4
-rw-r--r--libobjc/objc/Object.h14
-rw-r--r--libobjc/objc/README13
-rw-r--r--libobjc/objc/deprecated/Object.h13
-rw-r--r--libobjc/objc/deprecated/README11
-rw-r--r--libobjc/objc/deprecated/objc-unexpected-exception.h9
-rw-r--r--libobjc/objc/deprecated/typedstream.h141
-rw-r--r--libobjc/objc/objc-api.h11
-rw-r--r--libobjc/objc/objc-exception.h4
-rw-r--r--libobjc/objc/typedstream.h142
13 files changed, 244 insertions, 165 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index f4f8e18a635..9ab7b51c463 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,30 @@
+2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc/deprecated: New directory.
+ * objc/deprecated/README: New file.
+ * objc/README: New file.
+ * objc/typedstream.h: Moved into objc/deprecated/typedstream.h;
+ objc/typedstream.h replaced with a placeholder including the file
+ from the deprecated/ directory.
+ * objc/deprecated/objc-unexpected-exception.h: New file with the
+ definition of _objc_unexpected_exception.
+ * objc/objc-api.h: Include deprecated/objc-unexcepted-exception.h
+ instead of defining _objc_unexpected_exception.
+ * objc/deprecated/Object.h: New file with the deprecated Object
+ methods in a 'Deprecated' category.
+ * objc/Object.h Include deprecated/Object.h instead of defining
+ the deprecated methods.
+ * Object.m: Moved deprecated methods into 'Deprecated' category.
+ * objc-private: New directory.
+ * objc-private/README: New file.
+ * Makefile.in (OBJC_DEPRECATED_H): New variable.
+ (install-headers): Create installation directory for
+ OBJC_DEPRECATED_H headers, and install them.
+
+2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc/objc-exception.h: Fixed include of objc.h.
+
2010-09-08 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/objc-exception.h: New file.
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index d48c8dd88d9..a47f7ea344b 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -141,12 +141,18 @@ FLAGS_TO_PASS = \
all: libobjc$(libsuffix).la $(OBJC_BOEHM_GC)
: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
-# User-visible header files.
+# User-visible header files, from the objc/ directory
OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h objc-exception.h \
NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
thr.h objc-decls.h
+# User-visible header files containing deprecated APIs, from the
+# objc/deprecated directory
+
+OBJC_DEPRECATED_H = Object.h objc-unexpected-exception.h \
+ typedstream.h
+
# Modules that comprise the runtime library.
OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
@@ -346,6 +352,11 @@ install-headers:
realfile=$(srcdir)/objc/$${file}; \
$(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
done
+ $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated
+ for file in $(OBJC_DEPRECATED_H); do \
+ realfile=$(srcdir)/objc/deprecated/$${file}; \
+ $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc/deprecated; \
+ done
check uninstall install-strip dist installcheck installdirs:
diff --git a/libobjc/Object.m b/libobjc/Object.m
index ead9c8d2119..377f0594d1b 100644
--- a/libobjc/Object.m
+++ b/libobjc/Object.m
@@ -343,6 +343,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
class_set_version(self, aVersion);
return self;
}
+@end
+
+/* The following methods were deprecated in GCC 4.6.0 and will be
+ removed in the next GCC release.
+*/
+
+@implementation Object (Deprecated)
+ (int)streamVersion: (TypedStream*)aStream
{
diff --git a/libobjc/objc-private/README b/libobjc/objc-private/README
new file mode 100644
index 00000000000..cce1d041675
--- /dev/null
+++ b/libobjc/objc-private/README
@@ -0,0 +1,4 @@
+This directory contains headers that are private to the runtime and
+that are only included while the runtime is being compiled. They are
+not installed, so developers using the library can't actually even see
+them.
diff --git a/libobjc/objc/Object.h b/libobjc/objc/Object.h
index 45c74deaca7..e5c32f1447f 100644
--- a/libobjc/objc/Object.h
+++ b/libobjc/objc/Object.h
@@ -40,7 +40,7 @@ extern "C" {
tests, and when writing language/runtime testcases.
Because Objective-C allows multiple root classes, a Foundation
- library (such as GNUstep-base) is expected to provide its own root
+ library (such as GNUstep Base) is expected to provide its own root
class (typically called NSObject), fully integrated with the
library's own high-level features. If you are using such a
Foundation library, you should most likely use its root class for
@@ -130,18 +130,10 @@ extern "C" {
/* Archiving */
+ (int)version;
+ setVersion:(int)aVersion;
-
-/* The following methods were deprecated in GCC 4.6.0 and will be
- removed in the next GCC release.
-*/
-+ (int)streamVersion: (TypedStream*)aStream; /* __attribute__ ((deprecated)) */
-
-- read: (TypedStream*)aStream; /* __attribute__ ((deprecated)) */
-- write: (TypedStream*)aStream; /* __attribute__ ((deprecated)) */
-- awake; /* __attribute__ ((deprecated)) */
-
@end
+#include "deprecated/Object.h"
+
#ifdef __cplusplus
}
#endif
diff --git a/libobjc/objc/README b/libobjc/objc/README
new file mode 100644
index 00000000000..4a8be6e563e
--- /dev/null
+++ b/libobjc/objc/README
@@ -0,0 +1,13 @@
+This directory contains the public headers that are installed when
+libobjc is installed.
+
+Deprecated parts of the API should be moved into objc/deprecated and
+then included by public headers until they are finally removed. For
+example, if objc-api.h contains an _objc_unexpected_exception variable
+which is then deprecated, it should be moved into a header in
+objc/deprecated. This header is then included into objc-api.h.
+
+The result is that all the deprecated parts of the API are clearly
+separated in objc/deprecated, while objc/ retains only the current public
+API.
+
diff --git a/libobjc/objc/deprecated/Object.h b/libobjc/objc/deprecated/Object.h
new file mode 100644
index 00000000000..0241f0fd850
--- /dev/null
+++ b/libobjc/objc/deprecated/Object.h
@@ -0,0 +1,13 @@
+@interface Object (Deprecated)
+
+/* The following methods were deprecated in GCC 4.6.0 and will be
+ removed in the next GCC release.
+*/
++ (int)streamVersion: (TypedStream*)aStream; /* __attribute__ ((deprecated)) */
+
+- read: (TypedStream*)aStream; /* __attribute__ ((deprecated)) */
+- write: (TypedStream*)aStream; /* __attribute__ ((deprecated)) */
+- awake; /* __attribute__ ((deprecated)) */
+
+@end
+
diff --git a/libobjc/objc/deprecated/README b/libobjc/objc/deprecated/README
new file mode 100644
index 00000000000..3f105196e63
--- /dev/null
+++ b/libobjc/objc/deprecated/README
@@ -0,0 +1,11 @@
+This directory contains declarations and features that are deprecated
+and that will be removed in future versions of the compiler.
+
+Note that files in this directory are not really usable headers on
+their own - they shouldn't be included directly by end users. They
+are header fragments containing deprecated APIs that are still
+included (until removed) from the real headers in objc/.
+
+Files in this directory should not #include any other objc header.
+Any include that they need should be done in the real objc/ headers
+before including these fragments.
diff --git a/libobjc/objc/deprecated/objc-unexpected-exception.h b/libobjc/objc/deprecated/objc-unexpected-exception.h
new file mode 100644
index 00000000000..69ffd4e87da
--- /dev/null
+++ b/libobjc/objc/deprecated/objc-unexpected-exception.h
@@ -0,0 +1,9 @@
+/*
+** Hook for uncaught exceptions. This hook is called when an
+** exception is thrown and no valid exception handler is in place.
+** The function is expected never to return. If the function returns
+** the result is currently undefined. This is deprecated. Please use
+** objc_set_uncaught_exception_handler() from objc/objc-exception.h
+** instead.
+*/
+objc_EXPORT void (*_objc_unexpected_exception)(id) __attribute__ ((deprecated));
diff --git a/libobjc/objc/deprecated/typedstream.h b/libobjc/objc/deprecated/typedstream.h
new file mode 100644
index 00000000000..4d948d5fb27
--- /dev/null
+++ b/libobjc/objc/deprecated/typedstream.h
@@ -0,0 +1,141 @@
+/* GNU Objective-C Typed Streams interface.
+ Copyright (C) 1993, 1995, 2004, 2009 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3, or (at your option) any
+later version.
+
+GCC 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 General Public
+License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+#ifndef __typedstream_INCLUDE_GNU
+#define __typedstream_INCLUDE_GNU
+
+/* The API in this file was entirely deprecated in GCC 4.6.0 and will
+ be removed in the following GCC release.
+*/
+
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef int (*objc_typed_read_func)(void*, char*, int);
+typedef int (*objc_typed_write_func)(void*, const char*, int);
+typedef int (*objc_typed_flush_func)(void*);
+typedef int (*objc_typed_eof_func)(void*);
+
+#define OBJC_READONLY 0x01
+#define OBJC_WRITEONLY 0x02
+
+#define OBJC_MANAGED_STREAM 0x01
+#define OBJC_FILE_STREAM 0x02
+#define OBJC_MEMORY_STREAM 0x04
+
+#define OBJC_TYPED_STREAM_VERSION 0x01
+
+typedef struct objc_typed_stream {
+ void* physical;
+ cache_ptr object_table; /* read/written objects */
+ cache_ptr stream_table; /* other read/written but shared things.. */
+ cache_ptr class_table; /* class version mapping */
+ cache_ptr object_refs; /* forward references */
+ int mode; /* OBJC_READONLY or OBJC_WRITEONLY */
+ int type; /* MANAGED, FILE, MEMORY etc bit string */
+ int version; /* version used when writing */
+ int writing_root_p;
+ objc_typed_read_func read;
+ objc_typed_write_func write;
+ objc_typed_eof_func eof;
+ objc_typed_flush_func flush;
+} TypedStream;
+
+/* opcode masks */
+#define _B_VALUE 0x1fU
+#define _B_CODE 0xe0U
+#define _B_SIGN 0x10U
+#define _B_NUMBER 0x0fU
+
+/* standard opcodes */
+#define _B_INVALID 0x00U
+#define _B_SINT 0x20U
+#define _B_NINT 0x40U
+#define _B_SSTR 0x60U
+#define _B_NSTR 0x80U
+#define _B_RCOMM 0xa0U
+#define _B_UCOMM 0xc0U
+#define _B_EXT 0xe0U
+
+/* eXtension opcodes */
+#define _BX_OBJECT 0x00U
+#define _BX_CLASS 0x01U
+#define _BX_SEL 0x02U
+#define _BX_OBJREF 0x03U
+#define _BX_OBJROOT 0x04U
+#define _BX_EXT 0x1fU
+
+/*
+** Read and write objects as specified by TYPE. All the `last'
+** arguments are pointers to the objects to read/write.
+*/
+
+int objc_write_type (TypedStream* stream, const char* type, const void* data) __attribute__ ((deprecated));
+int objc_read_type (TypedStream* stream, const char* type, void* data) __attribute__ ((deprecated));
+
+int objc_write_types (TypedStream* stream, const char* type, ...) __attribute__ ((deprecated));
+int objc_read_types (TypedStream* stream, const char* type, ...) __attribute__ ((deprecated));
+
+int objc_write_object_reference (TypedStream* stream, id object) __attribute__ ((deprecated));
+int objc_write_root_object (TypedStream* stream, id object) __attribute__ ((deprecated));
+
+long objc_get_stream_class_version (TypedStream* stream, Class class_type) __attribute__ ((deprecated));
+
+
+/*
+** Convenience functions
+*/
+
+int objc_write_array (TypedStream* stream, const char* type,
+ int count, const void* data) __attribute__ ((deprecated));
+int objc_read_array (TypedStream* stream, const char* type,
+ int count, void* data) __attribute__ ((deprecated));
+
+int objc_write_object (TypedStream* stream, id object) __attribute__ ((deprecated));
+int objc_read_object (TypedStream* stream, id* object) __attribute__ ((deprecated));
+
+
+
+/*
+** Open a typed stream for reading or writing. MODE may be either of
+** OBJC_READONLY or OBJC_WRITEONLY.
+*/
+
+TypedStream* objc_open_typed_stream (FILE* physical, int mode) __attribute__ ((deprecated));
+TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode) __attribute__ ((deprecated));
+
+void objc_close_typed_stream (TypedStream* stream) __attribute__ ((deprecated));
+
+BOOL objc_end_of_typed_stream (TypedStream* stream) __attribute__ ((deprecated));
+void objc_flush_typed_stream (TypedStream* stream) __attribute__ ((deprecated));
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* not __typedstream_INCLUDE_GNU */
diff --git a/libobjc/objc/objc-api.h b/libobjc/objc/objc-api.h
index 8a634a44442..f58448456d6 100644
--- a/libobjc/objc/objc-api.h
+++ b/libobjc/objc/objc-api.h
@@ -430,16 +430,7 @@ objc_EXPORT void (*_objc_free)(void *);
objc_EXPORT IMP (*__objc_msg_forward)(SEL);
objc_EXPORT IMP (*__objc_msg_forward2)(id, SEL);
-/*
-** Hook for uncaught exceptions. This hook is called when an
-** exception is thrown and no valid exception handler is in place.
-** The function is expected never to return. If the function returns
-** the result is currently undefined. This is deprecated. Please use
-** objc_set_uncaught_exception_handler() from objc/objc-exception.h
-** instead.
-*/
-objc_EXPORT void (*_objc_unexpected_exception)(id) __attribute__ ((deprecated));
-
+#include "deprecated/objc-unexpected-exception.h"
Method_t class_get_class_method(MetaClass _class, SEL aSel);
diff --git a/libobjc/objc/objc-exception.h b/libobjc/objc/objc-exception.h
index e12ff3a7e73..715152d02e9 100644
--- a/libobjc/objc/objc-exception.h
+++ b/libobjc/objc/objc-exception.h
@@ -26,7 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef __objc_exception_INCLUDE_GNU
#define __objc_exception_INCLUDE_GNU
-#include <objc/objc.h>
+#include "objc.h"
#ifdef __cplusplus
extern "C" {
@@ -68,7 +68,7 @@ void objc_exception_throw (id exception);
exception handling. They are not thread safe and should be called
during the program initialization before threads are started. They
are mostly reserved for "Foundation" libraries; in the case of
- GNUstep, gnustep-base may be using these functions to improve the
+ GNUstep, GNUstep Base may be using these functions to improve the
standard exception handling. You probably shouldn't use these
functions unless you are writing your own Foundation library.
*/
diff --git a/libobjc/objc/typedstream.h b/libobjc/objc/typedstream.h
index 34ac061dc7e..2d4f72d5965 100644
--- a/libobjc/objc/typedstream.h
+++ b/libobjc/objc/typedstream.h
@@ -1,144 +1,4 @@
-/* GNU Objective-C Typed Streams interface.
- Copyright (C) 1993, 1995, 2004, 2009 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 3, or (at your option) any
-later version.
-
-GCC 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 General Public
-License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-
-#ifndef __typedstream_INCLUDE_GNU
-#define __typedstream_INCLUDE_GNU
-
-/* The API in this file was entirely deprecated in GCC 4.6.0 and will
- be removed in the following GCC release.
-*/
-
#include "objc.h"
#include "hash.h"
+#include "deprecated/typedstream.h"
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef int (*objc_typed_read_func)(void*, char*, int);
-typedef int (*objc_typed_write_func)(void*, const char*, int);
-typedef int (*objc_typed_flush_func)(void*);
-typedef int (*objc_typed_eof_func)(void*);
-
-#define OBJC_READONLY 0x01
-#define OBJC_WRITEONLY 0x02
-
-#define OBJC_MANAGED_STREAM 0x01
-#define OBJC_FILE_STREAM 0x02
-#define OBJC_MEMORY_STREAM 0x04
-
-#define OBJC_TYPED_STREAM_VERSION 0x01
-
-typedef struct objc_typed_stream {
- void* physical;
- cache_ptr object_table; /* read/written objects */
- cache_ptr stream_table; /* other read/written but shared things.. */
- cache_ptr class_table; /* class version mapping */
- cache_ptr object_refs; /* forward references */
- int mode; /* OBJC_READONLY or OBJC_WRITEONLY */
- int type; /* MANAGED, FILE, MEMORY etc bit string */
- int version; /* version used when writing */
- int writing_root_p;
- objc_typed_read_func read;
- objc_typed_write_func write;
- objc_typed_eof_func eof;
- objc_typed_flush_func flush;
-} TypedStream;
-
-/* opcode masks */
-#define _B_VALUE 0x1fU
-#define _B_CODE 0xe0U
-#define _B_SIGN 0x10U
-#define _B_NUMBER 0x0fU
-
-/* standard opcodes */
-#define _B_INVALID 0x00U
-#define _B_SINT 0x20U
-#define _B_NINT 0x40U
-#define _B_SSTR 0x60U
-#define _B_NSTR 0x80U
-#define _B_RCOMM 0xa0U
-#define _B_UCOMM 0xc0U
-#define _B_EXT 0xe0U
-
-/* eXtension opcodes */
-#define _BX_OBJECT 0x00U
-#define _BX_CLASS 0x01U
-#define _BX_SEL 0x02U
-#define _BX_OBJREF 0x03U
-#define _BX_OBJROOT 0x04U
-#define _BX_EXT 0x1fU
-
-/*
-** Read and write objects as specified by TYPE. All the `last'
-** arguments are pointers to the objects to read/write.
-*/
-
-int objc_write_type (TypedStream* stream, const char* type, const void* data) __attribute__ ((deprecated));
-int objc_read_type (TypedStream* stream, const char* type, void* data) __attribute__ ((deprecated));
-
-int objc_write_types (TypedStream* stream, const char* type, ...) __attribute__ ((deprecated));
-int objc_read_types (TypedStream* stream, const char* type, ...) __attribute__ ((deprecated));
-
-int objc_write_object_reference (TypedStream* stream, id object) __attribute__ ((deprecated));
-int objc_write_root_object (TypedStream* stream, id object) __attribute__ ((deprecated));
-
-long objc_get_stream_class_version (TypedStream* stream, Class class_type) __attribute__ ((deprecated));
-
-
-/*
-** Convenience functions
-*/
-
-int objc_write_array (TypedStream* stream, const char* type,
- int count, const void* data) __attribute__ ((deprecated));
-int objc_read_array (TypedStream* stream, const char* type,
- int count, void* data) __attribute__ ((deprecated));
-
-int objc_write_object (TypedStream* stream, id object) __attribute__ ((deprecated));
-int objc_read_object (TypedStream* stream, id* object) __attribute__ ((deprecated));
-
-
-
-/*
-** Open a typed stream for reading or writing. MODE may be either of
-** OBJC_READONLY or OBJC_WRITEONLY.
-*/
-
-TypedStream* objc_open_typed_stream (FILE* physical, int mode) __attribute__ ((deprecated));
-TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode) __attribute__ ((deprecated));
-
-void objc_close_typed_stream (TypedStream* stream) __attribute__ ((deprecated));
-
-BOOL objc_end_of_typed_stream (TypedStream* stream) __attribute__ ((deprecated));
-void objc_flush_typed_stream (TypedStream* stream) __attribute__ ((deprecated));
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* not __typedstream_INCLUDE_GNU */
OpenPOWER on IntegriCloud