This commit was generated by cvs2svn to compensate for changes in r22248,

which included commits to RCS files with non-trunk default branches.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/libobjc/trunk@22249 72102866-910b-0410-8b05-ffd578937521
main
fedor 20 years ago
parent 36cb7a5ec6
commit b42a61e7f2

@ -1,22 +1,23 @@
#Makefile for GNU Objective C runtime library. # Makefile for GNU Objective C runtime library.
#Copyright (C) 1993, 95-98, 1999, 2001 Free Software Foundation, Inc. # Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
#This file is part of GNU CC. #This file is part of GCC.
#GNU CC is free software; you can redistribute it and/or modify #GCC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by #it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option) #the Free Software Foundation; either version 2, or (at your option)
#any later version. #any later version.
#GNU CC is distributed in the hope that it will be useful, #GCC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of #but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details. #GNU General Public License for more details.
#You should have received a copy of the GNU General Public License #You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING. If not, write to #along with GCC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330, #the Free Software Foundation, 51 Franklin Street, Fifth Floor,
#Boston, MA 02111-1307, USA. */ #Boston, MA 02110-1301, USA. */
#This was cribbed from the libchill, libiberty and libstdc++ #This was cribbed from the libchill, libiberty and libstdc++
#Makefile.in files. Some of this stuff may be unnecessary and #Makefile.in files. Some of this stuff may be unnecessary and
@ -31,19 +32,24 @@ srcdir = @glibcpp_srcdir@
VPATH = @glibcpp_srcdir@ VPATH = @glibcpp_srcdir@
prefix = @prefix@ prefix = @prefix@
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
target_alias = @target_alias@ target_noncanonical = @target_noncanonical@
gcc_version = @gcc_version@ gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
gcc_version_trigger = @gcc_version_trigger@ host_subdir = @host_subdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
toplevel_srcdir = @toplevel_srcdir@ toplevel_srcdir = @toplevel_srcdir@
toolexecdir = @glibcpp_toolexecdir@ toolexecdir = @toolexecdir@
glibcpp_toolexecdir = @glibcpp_toolexecdir@ # Toolexecdir is used only by toolexeclibdir
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@ toolexeclibdir = @toolexeclibdir@
includedirname = @includedirname@
libext = @libext@
extra_ldflags_libobjc = @extra_ldflags_libobjc@
top_builddir = . top_builddir = .
libdir = $(exec_prefix)/lib libdir = $(exec_prefix)/lib
libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
# Multilib support variables. # Multilib support variables.
MULTISRCTOP = MULTISRCTOP =
@ -68,35 +74,26 @@ RANLIB = @RANLIB@
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
GTHREAD_FLAGS=@GTHREAD_FLAGS@
ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \ ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
$(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions
# Libtool # Libtool
# The following strings describe the version of the obj-C library # The following strings describe the version of the obj-C library
# begin compiled and compatibility issues. # begin compiled and compatibility issues.
# Please refer to Libtool documentation about how to manage these # Please refer to Libtool documentation about how to manage these
# numbers. # numbers.
LIBOBJC_VERSION = 1:0:0 LIBOBJC_VERSION = @VERSION@
LIBOBJC_GC_VERSION = 1:0:0 LIBOBJC_GC_VERSION = @VERSION@
# @LIBTOOL@ does not get it right, so we hack it in - FIXME LIBTOOL = @LIBTOOL@
LIBTOOL = ./libtool
LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
LIBTOOL_LINK = $(LIBTOOL) --mode=link LIBTOOL_LINK = $(LIBTOOL) --mode=link
LIBTOOL_INSTALL = $(LIBTOOL) --mode=install LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
#LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall #LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
#
# Define the cc1obj in terms of the CC that is passed on from higher
# level make. This is needed to make sure we can create runtime-info.h
# when doing canadian cross builds where running ../../gcc/cc1obj
# does not make any sense.
#
CC1OBJ = `$(CC) -print-prog-name=cc1obj`
INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \ INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \ -I$(srcdir)/$(MULTISRCTOP)../gcc/config \
-I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
-I$(srcdir)/$(MULTISRCTOP)../include -I$(srcdir)/$(MULTISRCTOP)../include
OBJC_GCFLAGS=-DOBJC_WITH_GC=1 OBJC_GCFLAGS=-DOBJC_WITH_GC=1
@ -137,33 +134,33 @@ FLAGS_TO_PASS = \
"libsubdir=$(libsubdir)" \ "libsubdir=$(libsubdir)" \
"tooldir=$(tooldir)" "tooldir=$(tooldir)"
all: libobjc.la $(OBJC_BOEHM_GC) all: libobjc$(libext).la $(OBJC_BOEHM_GC)
: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
# User-visible header files. # User-visible header files.
OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \ OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \ NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
thr.h thr.h objc-decls.h
# Modules that comprise the runtime library. # Modules that comprise the runtime library.
OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \ OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \
misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \ misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \
Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \ Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \
$(OBJC_THREAD_FILE).lo $(OBJC_THREAD_FILE).lo exception.lo
OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \ OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \
init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \ init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \
NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \ NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \
sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \ sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \
$(OBJC_THREAD_FILE)_gc.lo $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo
runtime-info.h: runtime-info.h:
echo "" > tmp-runtime echo "" > tmp-runtime.m
echo "/* This file is automatically generated */" > $@ echo "/* This file is automatically generated */" > $@
$(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@ $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
rm -f tmp-runtime rm -f tmp-runtime.m tmp-runtime.s
archive_gc.lo: archive.c archive_gc.lo: archive.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
@ -259,17 +256,25 @@ $(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
$(INCLUDES) $< $(INCLUDES) $<
exception.lo: exception.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \
-fexceptions $(INCLUDES) $<
exception_gc.lo: exception.c
$(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \
-fexceptions $(INCLUDES) $<
doc: info dvi html doc: info dvi html
libobjc.la: $(OBJS) libobjc$(libext).la: $(OBJS)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
-rpath $(glibcpp_toolexeclibdir) \ -rpath $(toolexeclibdir) \
-version-info $(LIBOBJC_VERSION) -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc)
libobjc_gc.la: $(OBJS_GC) libobjc_gc$(libext).la: $(OBJS_GC)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \ $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
-rpath $(glibcpp_toolexeclibdir) \ -rpath $(toolexeclibdir) \
-version-info $(LIBOBJC_GC_VERSION) -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc)
# #
# FIXME -- The following part does not fit in the libtool context. # FIXME -- The following part does not fit in the libtool context.
@ -312,34 +317,34 @@ config.status: configure
CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
${srcdir}/configure: configure.in ${srcdir}/configure: @MAINT@ configure.ac
rm -f config.cache rm -f config.cache
cd ${srcdir} && autoconf cd ${srcdir} && autoconf
install: install-libs install-headers install: install-libs install-headers
install-libs: installdirs install-libs: installdirs
$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(glibcpp_toolexeclibdir) $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
$(LIBTOOL_INSTALL) $(INSTALL) libobjc.la $(DESTDIR)$(glibcpp_toolexeclibdir); $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir);
if [ "$(OBJC_BOEHM_GC)" ]; then \ if [ "$(OBJC_BOEHM_GC)" ]; then \
$(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc.la \ $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \
$(DESTDIR)$(glibcpp_toolexeclibdir);\ $(DESTDIR)$(toolexeclibdir);\
fi fi
$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@" $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
@-$(LIBTOOL) --mode=finish $(DESTDIR)$(glibcpp_toolexeclibdir) @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir)
# Copy Objective C headers to installation include directory. # Copy Objective C headers to installation include directory.
install-headers: install-headers:
$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/include/objc $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
for file in $(OBJC_H); do \ for file in $(OBJC_H); do \
realfile=$(srcdir)/objc/$${file}; \ realfile=$(srcdir)/objc/$${file}; \
$(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/include/objc; \ $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
done done
check uninstall install-strip dist installcheck installdirs: check uninstall install-strip dist installcheck installdirs:
mostlyclean: mostlyclean:
-$(LIBTOOL_CLEAN) rm -f libobjc.la libobjc_gc.la *.lo -$(LIBTOOL_CLEAN) rm -f libobjc$(libext).la libobjc_gc$(libext).la *.lo
-rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \ -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \
fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \ fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
*.toc *.tp *.vr *.html libobj.exp *.toc *.tp *.vr *.html libobj.exp
@ -357,3 +362,7 @@ maintainer-clean realclean: distclean
.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \ .PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
install-strip dist installcheck installdirs install-strip dist installcheck installdirs
# Don't export variables to the environment, in order to not confuse
# configure.
.NOEXPORT:

@ -2,22 +2,22 @@
Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl> Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details. License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause

@ -1,22 +1,22 @@
/* The implementation of class Object for Objective-C. /* The implementation of class Object for Objective-C.
Copyright (C) 1993, 1994, 1995, 1997, 2002 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1995, 1997, 2002 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details. License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled /* As a special exception, if you link this library with files compiled
with GCC to produce an executable, this does not cause the resulting with GCC to produce an executable, this does not cause the resulting

@ -39,19 +39,26 @@ adopts it -- it is not enough to inherit them. The flag
`-Wprotocols' is the default which requires them defined. `-Wprotocols' is the default which requires them defined.
+load
===========
This method, if defined, is called for each class and category
implementation when the class is loaded into the runtime. This method
is not inherited, and is thus not called for a subclass that doesn't
define it itself. Thus, each +load method is called exactly once by
the runtime. The runtime invocation of this method is thread safe.
+initialize +initialize
=========== ===========
This method, if defined, is called before any other instance or class This method, if defined, is called before any other instance or class
methods of that particular class. This method is not inherited, and methods of that particular class. For the GNU runtime, this method is
is thus not called as initializer for a subclass that doesn't define not inherited, and is thus not called as initializer for a subclass that
it itself. Thus, each +initialize method is called exactly once (or doesn't define it itself. Thus, each +initialize method is called exactly
never if no methods of that particular class is never called). once by the runtime (or never if no methods of that particular class is
Besides this, it is allowed to have several +initialize methods, one never called). It is wise to guard against multiple invocations anyway
for each category. The order in which these (multiple methods) are to remain portable with the NeXT runtime. The runtime invocation of
called is not well defined. I am not completely certain what the this method is thread safe.
semantics of this method is for other implementations, but this is
how it works for GNU Objective C.
Passivation/Activation/Typedstreams Passivation/Activation/Typedstreams

418
aclocal.m4 vendored

@ -1,231 +1,201 @@
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # generated automatically by aclocal 1.9.3 -*- Autoconf -*-
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
dnl with or without modifications, as long as this notice is preserved. # Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
dnl This program is distributed in the hope that it will be useful, # gives unlimited permission to copy and/or distribute it,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without # with or without modifications, as long as this notice is preserved.
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE. # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl Initialize configure bits. # PARTICULAR PURPOSE.
dnl
dnl GLIBCPP_TOPREL_CONFIGURE # AM_AUX_DIR_EXPAND
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
dnl Default to --enable-multilib # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
AC_ARG_ENABLE(multilib,
[ --enable-multilib build hella library versions (default)], # This program is free software; you can redistribute it and/or modify
[case "${enableval}" in # it under the terms of the GNU General Public License as published by
yes) multilib=yes ;; # the Free Software Foundation; either version 2, or (at your option)
no) multilib=no ;; # any later version.
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [multilib=yes])dnl # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# When building with srcdir == objdir, links to the source files will # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# be created in directories within the target_subdir. We have to # GNU General Public License for more details.
# adjust toplevel_srcdir accordingly, so that configure finds
# install-sh and other auxiliary files that live in the top-level # You should have received a copy of the GNU General Public License
# source directory. # along with this program; if not, write to the Free Software
if test "${srcdir}" = "."; then # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
if test -z "${with_target_subdir}"; then # 02110-1301, USA.
toprel=".."
else # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
if test "${with_target_subdir}" != "."; then # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
toprel="${with_multisrctop}../.." # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
else #
toprel="${with_multisrctop}.." # Of course, Automake must honor this variable whenever it calls a
fi # tool from the auxiliary directory. The problem is that $srcdir (and
fi # therefore $ac_aux_dir as well) can be either absolute or relative,
else # depending on how configure is run. This is pretty annoying, since
toprel=".." # it makes $ac_aux_dir quite unusable in subdirectories: in the top
fi # source directory, any form will work fine, but in subdirectories a
AC_CONFIG_AUX_DIR(${srcdir}/$toprel) # relative path needs to be adjusted first.
toplevel_srcdir=\${top_srcdir}/$toprel #
AC_SUBST(toplevel_srcdir) # $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
]) ])
dnl # AM_CONDITIONAL -*- Autoconf -*-
dnl Initialize configure bits.
dnl # Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [ # This program is free software; you can redistribute it and/or modify
# Export build and source directories. # it under the terms of the GNU General Public License as published by
# These need to be absolute paths, yet at the same time need to # the Free Software Foundation; either version 2, or (at your option)
# canonicalize only relative paths, because then amd will not unmount # any later version.
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
glibcpp_builddir=`${PWDCMD-pwd}` # This program is distributed in the hope that it will be useful,
case $srcdir in # but WITHOUT ANY WARRANTY; without even the implied warranty of
[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;; # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; # GNU General Public License for more details.
esac
AC_SUBST(glibcpp_builddir) # You should have received a copy of the GNU General Public License
AC_SUBST(glibcpp_srcdir) # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl This is here just to satisfy automake. # 02110-1301, USA.
ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
# serial 6
# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
# be 'cp -p' if linking isn't available. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
#ac_cv_prog_LN_S='cp -p' # -------------------------------------
AC_PROG_LN_S # Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
# We use these options to decide which functions to include. [AC_PREREQ(2.52)dnl
AC_ARG_WITH(target-subdir, ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[ --with-target-subdir=SUBDIR [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
configuring in a subdirectory]) AC_SUBST([$1_TRUE])
AC_ARG_WITH(cross-host, AC_SUBST([$1_FALSE])
[ --with-cross-host=HOST configuring with a cross compiler]) if $2; then
$1_TRUE=
# Never versions of autoconf add an underscore to these functions. $1_FALSE='#'
# Prevent future problems ...
ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
# AC_PROG_CC
# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are probably using a cross compiler, which will not be able to fully
# link an executable. This should really be fixed in autoconf
# itself.
AC_DEFUN(LIB_AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
dnl Fool anybody using AC_PROG_CC.
AC_PROVIDE([AC_PROG_CC])
AC_CHECK_PROG(CC, gcc, gcc)
if test -z "$CC"; then
AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi
AC_PROG_CC_GNU
if test $ac_cv_prog_gcc = yes; then
GCC=yes
dnl Check whether -g works, even if CFLAGS is set, in case the package
dnl plays around with CFLAGS (such as to build both debugging and
dnl normal versions of a library), tasteless as that idea is.
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
AC_PROG_CC_G
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-O2"
fi
else else
GCC= $1_TRUE='#'
test "${CFLAGS+set}" = set || CFLAGS="-g" $1_FALSE=
fi fi
]) AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
LIB_AC_PROG_CC AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
AC_CHECK_TOOL(AS, as) fi])])
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) # Add --enable-maintainer-mode option to configure.
AC_PROG_INSTALL # From Jim Meyering
# We need AC_EXEEXT to keep automake happy in cygnus mode. However, # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
# at least currently, we never actually build a program, so we never # Free Software Foundation, Inc.
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler # This program is free software; you can redistribute it and/or modify
# which can't create executables. So we include AC_EXEEXT to keep # it under the terms of the GNU General Public License as published by
# automake happy, but we don't execute it, since we don't care about # the Free Software Foundation; either version 2, or (at your option)
# the result. # any later version.
if false; then
# autoconf 2.50 runs AC_EXEEXT by default, and the macro expands # This program is distributed in the hope that it will be useful,
# to nothing, so nothing would remain between `then' and `fi' if it # but WITHOUT ANY WARRANTY; without even the implied warranty of
# were not for the `:' below. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
: # GNU General Public License for more details.
AC_EXEEXT
fi # You should have received a copy of the GNU General Public License
]) # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
dnl
dnl GLIBCPP_EXPORT_INSTALL_INFO # serial 3
dnl calculates gxx_install_dir
dnl exports glibcpp_toolexecdir AC_DEFUN([AM_MAINTAINER_MODE],
dnl exports glibcpp_toolexeclibdir [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl exports glibcpp_prefixdir dnl maintainer-mode is disabled by default
dnl AC_ARG_ENABLE(maintainer-mode,
dnl Assumes cross_compiling bits already done, and with_cross_host in [ --enable-maintainer-mode enable make rules and dependencies not useful
dnl particular (and sometimes confusing) to the casual installer],
dnl USE_MAINTAINER_MODE=$enableval,
dnl GLIBCPP_EXPORT_INSTALL_INFO USE_MAINTAINER_MODE=no)
AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
# Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
# exported correctly in GLIBCPP_CONFIGURE. MAINT=$MAINTAINER_MODE_TRUE
glibcpp_toolexecdir=no AC_SUBST(MAINT)dnl
glibcpp_toolexeclibdir=no ]
glibcpp_prefixdir=${prefix} )
AC_MSG_CHECKING([for interface version number]) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
libstdcxx_interface=$INTERFACE
AC_MSG_RESULT($libstdcxx_interface) # serial 2
# Process the option "--enable-version-specific-runtime-libs" # AM_PROG_CC_C_O
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) # --------------
AC_ARG_ENABLE(version-specific-runtime-libs, # Like AC_PROG_CC_C_O, but changed for automake.
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
[case "$enableval" in # Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
yes) version_specific_libs=yes ;;
no) version_specific_libs=no ;; # This program is free software; you can redistribute it and/or modify
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; # it under the terms of the GNU General Public License as published by
esac], # the Free Software Foundation; either version 2, or (at your option)
version_specific_libs=no)dnl # any later version.
# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs) # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
gcc_version_trigger=${srcdir}/../gcc/version.c # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'` # GNU General Public License for more details.
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
AC_SUBST(gcc_version) # You should have received a copy of the GNU General Public License
AC_SUBST(gcc_version_trigger) # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
if test $version_specific_libs = yes; then # 02110-1301, USA.
# Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option AC_DEFUN([AM_PROG_CC_C_O],
# is selected. [AC_REQUIRE([AC_PROG_CC_C_O])dnl
changequote(,)dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)' # FIXME: we rely on the cache variable name because
glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)' # there is no other way.
changequote([,])dnl set dummy $CC
fi ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir # Losing compiler, so override with the script.
# Install a library built with a cross compiler in tooldir, not libdir. # FIXME: It is wrong to rewrite CC.
if test x"$glibcpp_toolexecdir" = x"no"; then # But if we don't then we get into trouble of one sort or another.
if test -n "$with_cross_host" && # A longer-term fix would be to have automake use am__CC in this case,
test x"$with_cross_host" != x"no"; then # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)' CC="$am_aux_dir/compile $CC"
glibcpp_toolexeclibdir='$(toolexecdir)/lib'
else
glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
glibcpp_toolexeclibdir='$(libdir)'
fi
glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/`$CC -print-multi-os-directory`
fi fi
AC_SUBST(glibcpp_prefixdir)
AC_SUBST(glibcpp_toolexecdir)
AC_SUBST(glibcpp_toolexeclibdir)
]) ])
sinclude(../libtool.m4) m4_include([acinclude.m4])
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
dnl add a definition of LIBTOOL to Makefile.in.
ifelse(,,,[AC_SUBST(LIBTOOL)
AC_DEFUN([AM_PROG_LIBTOOL])
AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
])

@ -1,22 +1,22 @@
/* GNU Objective C Runtime archiving /* GNU Objective C Runtime archiving
Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup Contributed by Kresten Krab Thorup
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -25,9 +25,9 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include "tconfig.h" #include "tconfig.h"
#include "runtime.h" #include "objc/runtime.h"
#include "typedstream.h" #include "objc/typedstream.h"
#include "encoding.h" #include "objc/encoding.h"
#include <stdlib.h> #include <stdlib.h>
extern int fflush (FILE *); extern int fflush (FILE *);
@ -62,7 +62,7 @@ const char *objc_skip_type (const char *type);
static void __objc_finish_write_root_object (struct objc_typed_stream *); static void __objc_finish_write_root_object (struct objc_typed_stream *);
static void __objc_finish_read_root_object (struct objc_typed_stream *); static void __objc_finish_read_root_object (struct objc_typed_stream *);
static __inline__ int static inline int
__objc_code_unsigned_char (unsigned char *buf, unsigned char val) __objc_code_unsigned_char (unsigned char *buf, unsigned char val)
{ {
if ((val&_B_VALUE) == val) if ((val&_B_VALUE) == val)
@ -84,10 +84,10 @@ objc_write_unsigned_char (struct objc_typed_stream *stream,
{ {
unsigned char buf[sizeof (unsigned char) + 1]; unsigned char buf[sizeof (unsigned char) + 1];
int len = __objc_code_unsigned_char (buf, value); int len = __objc_code_unsigned_char (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_char (unsigned char *buf, signed char val) __objc_code_char (unsigned char *buf, signed char val)
{ {
if (val >= 0) if (val >= 0)
@ -105,10 +105,10 @@ objc_write_char (struct objc_typed_stream *stream, signed char value)
{ {
unsigned char buf[sizeof (char) + 1]; unsigned char buf[sizeof (char) + 1];
int len = __objc_code_char (buf, value); int len = __objc_code_char (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_unsigned_short (unsigned char *buf, unsigned short val) __objc_code_unsigned_short (unsigned char *buf, unsigned short val)
{ {
if ((val&_B_VALUE) == val) if ((val&_B_VALUE) == val)
@ -143,10 +143,10 @@ objc_write_unsigned_short (struct objc_typed_stream *stream,
{ {
unsigned char buf[sizeof (unsigned short) + 1]; unsigned char buf[sizeof (unsigned short) + 1];
int len = __objc_code_unsigned_short (buf, value); int len = __objc_code_unsigned_short (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_short (unsigned char *buf, short val) __objc_code_short (unsigned char *buf, short val)
{ {
int sign = (val < 0); int sign = (val < 0);
@ -161,11 +161,11 @@ objc_write_short (struct objc_typed_stream *stream, short value)
{ {
unsigned char buf[sizeof (short) + 1]; unsigned char buf[sizeof (short) + 1];
int len = __objc_code_short (buf, value); int len = __objc_code_short (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_unsigned_int (unsigned char *buf, unsigned int val) __objc_code_unsigned_int (unsigned char *buf, unsigned int val)
{ {
if ((val&_B_VALUE) == val) if ((val&_B_VALUE) == val)
@ -199,10 +199,10 @@ objc_write_unsigned_int (struct objc_typed_stream *stream, unsigned int value)
{ {
unsigned char buf[sizeof (unsigned int) + 1]; unsigned char buf[sizeof (unsigned int) + 1];
int len = __objc_code_unsigned_int (buf, value); int len = __objc_code_unsigned_int (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_int (unsigned char *buf, int val) __objc_code_int (unsigned char *buf, int val)
{ {
int sign = (val < 0); int sign = (val < 0);
@ -217,10 +217,10 @@ objc_write_int (struct objc_typed_stream *stream, int value)
{ {
unsigned char buf[sizeof (int) + 1]; unsigned char buf[sizeof (int) + 1];
int len = __objc_code_int (buf, value); int len = __objc_code_int (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_unsigned_long (unsigned char *buf, unsigned long val) __objc_code_unsigned_long (unsigned char *buf, unsigned long val)
{ {
if ((val&_B_VALUE) == val) if ((val&_B_VALUE) == val)
@ -255,10 +255,10 @@ objc_write_unsigned_long (struct objc_typed_stream *stream,
{ {
unsigned char buf[sizeof (unsigned long) + 1]; unsigned char buf[sizeof (unsigned long) + 1];
int len = __objc_code_unsigned_long (buf, value); int len = __objc_code_unsigned_long (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
static __inline__ int static inline int
__objc_code_long (unsigned char *buf, long val) __objc_code_long (unsigned char *buf, long val)
{ {
int sign = (val < 0); int sign = (val < 0);
@ -273,7 +273,7 @@ objc_write_long (struct objc_typed_stream *stream, long value)
{ {
unsigned char buf[sizeof (long) + 1]; unsigned char buf[sizeof (long) + 1];
int len = __objc_code_long (buf, value); int len = __objc_code_long (buf, value);
return (*stream->write) (stream->physical, buf, len); return (*stream->write) (stream->physical, (char*)buf, len);
} }
@ -290,8 +290,8 @@ objc_write_string (struct objc_typed_stream *stream,
else /* _B_NINT */ else /* _B_NINT */
buf[0] = (buf[0]&_B_VALUE)|_B_NSTR; buf[0] = (buf[0]&_B_VALUE)|_B_NSTR;
if ((*stream->write) (stream->physical, buf, len) != 0) if ((*stream->write) (stream->physical, (char*)buf, len) != 0)
return (*stream->write) (stream->physical, string, nbytes); return (*stream->write) (stream->physical, (char*)string, nbytes);
else else
return 0; return 0;
} }
@ -301,12 +301,13 @@ objc_write_string_atomic (struct objc_typed_stream *stream,
unsigned char *string, unsigned int nbytes) unsigned char *string, unsigned int nbytes)
{ {
unsigned long key; unsigned long key;
if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, string)))) if ((key = PTR2LONG(objc_hash_value_for_key (stream->stream_table, string))))
return objc_write_use_common (stream, key); return objc_write_use_common (stream, key);
else else
{ {
int length; int length;
hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(string)), string); objc_hash_add (&stream->stream_table,
LONG2PTR(key=PTR2LONG(string)), string);
if ((length = objc_write_register_common (stream, key))) if ((length = objc_write_register_common (stream, key)))
return objc_write_string (stream, string, nbytes); return objc_write_string (stream, string, nbytes);
return length; return length;
@ -323,12 +324,12 @@ objc_write_register_common (struct objc_typed_stream *stream,
{ {
buf[0] = _B_RCOMM|0x01; buf[0] = _B_RCOMM|0x01;
buf[1] &= _B_VALUE; buf[1] &= _B_VALUE;
return (*stream->write) (stream->physical, buf, len + 1); return (*stream->write) (stream->physical, (char*)buf, len + 1);
} }
else else
{ {
buf[1] = (buf[1]&_B_VALUE)|_B_RCOMM; buf[1] = (buf[1]&_B_VALUE)|_B_RCOMM;
return (*stream->write) (stream->physical, buf + 1, len); return (*stream->write) (stream->physical, (char*)buf + 1, len);
} }
} }
@ -341,22 +342,22 @@ objc_write_use_common (struct objc_typed_stream *stream, unsigned long key)
{ {
buf[0] = _B_UCOMM|0x01; buf[0] = _B_UCOMM|0x01;
buf[1] &= _B_VALUE; buf[1] &= _B_VALUE;
return (*stream->write) (stream->physical, buf, 2); return (*stream->write) (stream->physical, (char*)buf, 2);
} }
else else
{ {
buf[1] = (buf[1]&_B_VALUE)|_B_UCOMM; buf[1] = (buf[1]&_B_VALUE)|_B_UCOMM;
return (*stream->write) (stream->physical, buf + 1, len); return (*stream->write) (stream->physical, (char*)buf + 1, len);
} }
} }
static __inline__ int static inline int
__objc_write_extension (struct objc_typed_stream *stream, unsigned char code) __objc_write_extension (struct objc_typed_stream *stream, unsigned char code)
{ {
if (code <= _B_VALUE) if (code <= _B_VALUE)
{ {
unsigned char buf = code|_B_EXT; unsigned char buf = code|_B_EXT;
return (*stream->write) (stream->physical, &buf, 1); return (*stream->write) (stream->physical, (char*)&buf, 1);
} }
else else
{ {
@ -366,7 +367,7 @@ __objc_write_extension (struct objc_typed_stream *stream, unsigned char code)
} }
} }
__inline__ int inline int
__objc_write_object (struct objc_typed_stream *stream, id object) __objc_write_object (struct objc_typed_stream *stream, id object)
{ {
unsigned char buf = '\0'; unsigned char buf = '\0';
@ -376,7 +377,7 @@ __objc_write_object (struct objc_typed_stream *stream, id object)
__objc_write_extension (stream, _BX_OBJECT); __objc_write_extension (stream, _BX_OBJECT);
objc_write_class (stream, object->class_pointer); objc_write_class (stream, object->class_pointer);
(*objc_msg_lookup (object, write_sel)) (object, write_sel, stream); (*objc_msg_lookup (object, write_sel)) (object, write_sel, stream);
return (*stream->write) (stream->physical, &buf, 1); return (*stream->write) (stream->physical, (char*)&buf, 1);
} }
else else
return objc_write_use_common (stream, 0); return objc_write_use_common (stream, 0);
@ -386,7 +387,7 @@ int
objc_write_object_reference (struct objc_typed_stream *stream, id object) objc_write_object_reference (struct objc_typed_stream *stream, id object)
{ {
unsigned long key; unsigned long key;
if ((key = PTR2LONG(hash_value_for_key (stream->object_table, object)))) if ((key = PTR2LONG(objc_hash_value_for_key (stream->object_table, object))))
return objc_write_use_common (stream, key); return objc_write_use_common (stream, key);
__objc_write_extension (stream, _BX_OBJREF); __objc_write_extension (stream, _BX_OBJREF);
@ -415,7 +416,7 @@ int
objc_write_object (struct objc_typed_stream *stream, id object) objc_write_object (struct objc_typed_stream *stream, id object)
{ {
unsigned long key; unsigned long key;
if ((key = PTR2LONG(hash_value_for_key (stream->object_table, object)))) if ((key = PTR2LONG(objc_hash_value_for_key (stream->object_table, object))))
return objc_write_use_common (stream, key); return objc_write_use_common (stream, key);
else if (object == nil) else if (object == nil)
@ -424,18 +425,19 @@ objc_write_object (struct objc_typed_stream *stream, id object)
else else
{ {
int length; int length;
hash_add (&stream->object_table, LONG2PTR(key=PTR2LONG(object)), object); objc_hash_add (&stream->object_table,
LONG2PTR(key=PTR2LONG(object)), object);
if ((length = objc_write_register_common (stream, key))) if ((length = objc_write_register_common (stream, key)))
return __objc_write_object (stream, object); return __objc_write_object (stream, object);
return length; return length;
} }
} }
__inline__ int inline int
__objc_write_class (struct objc_typed_stream *stream, struct objc_class *class) __objc_write_class (struct objc_typed_stream *stream, struct objc_class *class)
{ {
__objc_write_extension (stream, _BX_CLASS); __objc_write_extension (stream, _BX_CLASS);
objc_write_string_atomic (stream, (char *) class->name, objc_write_string_atomic (stream, (unsigned char *) class->name,
strlen ((char *) class->name)); strlen ((char *) class->name));
return objc_write_unsigned_long (stream, class->version); return objc_write_unsigned_long (stream, class->version);
} }
@ -446,12 +448,13 @@ objc_write_class (struct objc_typed_stream *stream,
struct objc_class *class) struct objc_class *class)
{ {
unsigned long key; unsigned long key;
if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, class)))) if ((key = PTR2LONG(objc_hash_value_for_key (stream->stream_table, class))))
return objc_write_use_common (stream, key); return objc_write_use_common (stream, key);
else else
{ {
int length; int length;
hash_add (&stream->stream_table, LONG2PTR(key = PTR2LONG(class)), class); objc_hash_add (&stream->stream_table,
LONG2PTR(key = PTR2LONG(class)), class);
if ((length = objc_write_register_common (stream, key))) if ((length = objc_write_register_common (stream, key)))
return __objc_write_class (stream, class); return __objc_write_class (stream, class);
return length; return length;
@ -459,16 +462,16 @@ objc_write_class (struct objc_typed_stream *stream,
} }
__inline__ int inline int
__objc_write_selector (struct objc_typed_stream *stream, SEL selector) __objc_write_selector (struct objc_typed_stream *stream, SEL selector)
{ {
const char *sel_name; const char *sel_name;
__objc_write_extension (stream, _BX_SEL); __objc_write_extension (stream, _BX_SEL);
/* to handle NULL selectors */ /* to handle NULL selectors */
if ((SEL)0 == selector) if ((SEL)0 == selector)
return objc_write_string (stream, "", 0); return objc_write_string (stream, (unsigned char*)"", 0);
sel_name = sel_get_name (selector); sel_name = sel_get_name (selector);
return objc_write_string (stream, sel_name, strlen ((char*)sel_name)); return objc_write_string (stream, (unsigned char*)sel_name, strlen ((char*)sel_name));
} }
int int
@ -482,12 +485,13 @@ objc_write_selector (struct objc_typed_stream *stream, SEL selector)
return __objc_write_selector (stream, selector); return __objc_write_selector (stream, selector);
sel_name = sel_get_name (selector); sel_name = sel_get_name (selector);
if ((key = PTR2LONG(hash_value_for_key (stream->stream_table, sel_name)))) if ((key = PTR2LONG(objc_hash_value_for_key (stream->stream_table,
sel_name))))
return objc_write_use_common (stream, key); return objc_write_use_common (stream, key);
else else
{ {
int length; int length;
hash_add (&stream->stream_table, objc_hash_add (&stream->stream_table,
LONG2PTR(key = PTR2LONG(sel_name)), (char *) sel_name); LONG2PTR(key = PTR2LONG(sel_name)), (char *) sel_name);
if ((length = objc_write_register_common (stream, key))) if ((length = objc_write_register_common (stream, key)))
return __objc_write_selector (stream, selector); return __objc_write_selector (stream, selector);
@ -501,12 +505,12 @@ objc_write_selector (struct objc_typed_stream *stream, SEL selector)
** Read operations ** Read operations
*/ */
__inline__ int inline int
objc_read_char (struct objc_typed_stream *stream, char *val) objc_read_char (struct objc_typed_stream *stream, char *val)
{ {
unsigned char buf; unsigned char buf;
int len; int len;
len = (*stream->read) (stream->physical, &buf, 1); len = (*stream->read) (stream->physical, (char*)&buf, 1);
if (len != 0) if (len != 0)
{ {
if ((buf & _B_CODE) == _B_SINT) if ((buf & _B_CODE) == _B_SINT)
@ -528,18 +532,18 @@ objc_read_char (struct objc_typed_stream *stream, char *val)
} }
__inline__ int inline int
objc_read_unsigned_char (struct objc_typed_stream *stream, unsigned char *val) objc_read_unsigned_char (struct objc_typed_stream *stream, unsigned char *val)
{ {
unsigned char buf; unsigned char buf;
int len; int len;
if ((len = (*stream->read) (stream->physical, &buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)&buf, 1)))
{ {
if ((buf & _B_CODE) == _B_SINT) if ((buf & _B_CODE) == _B_SINT)
(*val) = (buf & _B_VALUE); (*val) = (buf & _B_VALUE);
else if ((buf & _B_NUMBER) == 1) else if ((buf & _B_NUMBER) == 1)
len = (*stream->read) (stream->physical, val, 1); len = (*stream->read) (stream->physical, (char*)val, 1);
else else
objc_error (nil, OBJC_ERR_BAD_DATA, objc_error (nil, OBJC_ERR_BAD_DATA,
@ -549,12 +553,12 @@ objc_read_unsigned_char (struct objc_typed_stream *stream, unsigned char *val)
return len; return len;
} }
__inline__ int inline int
objc_read_short (struct objc_typed_stream *stream, short *value) objc_read_short (struct objc_typed_stream *stream, short *value)
{ {
unsigned char buf[sizeof (short) + 1]; unsigned char buf[sizeof (short) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
if ((buf[0] & _B_CODE) == _B_SINT) if ((buf[0] & _B_CODE) == _B_SINT)
(*value) = (buf[0] & _B_VALUE); (*value) = (buf[0] & _B_VALUE);
@ -566,7 +570,7 @@ objc_read_short (struct objc_typed_stream *stream, short *value)
if (nbytes > (int) sizeof (short)) if (nbytes > (int) sizeof (short))
objc_error (nil, OBJC_ERR_BAD_DATA, objc_error (nil, OBJC_ERR_BAD_DATA,
"expected short, got bigger (%dbits)", nbytes*8); "expected short, got bigger (%dbits)", nbytes*8);
len = (*stream->read) (stream->physical, buf + 1, nbytes); len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
(*value) = 0; (*value) = 0;
while (pos <= nbytes) while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++]; (*value) = ((*value)*0x100) + buf[pos++];
@ -577,13 +581,13 @@ objc_read_short (struct objc_typed_stream *stream, short *value)
return len; return len;
} }
__inline__ int inline int
objc_read_unsigned_short (struct objc_typed_stream *stream, objc_read_unsigned_short (struct objc_typed_stream *stream,
unsigned short *value) unsigned short *value)
{ {
unsigned char buf[sizeof (unsigned short) + 1]; unsigned char buf[sizeof (unsigned short) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
if ((buf[0] & _B_CODE) == _B_SINT) if ((buf[0] & _B_CODE) == _B_SINT)
(*value) = (buf[0] & _B_VALUE); (*value) = (buf[0] & _B_VALUE);
@ -595,7 +599,7 @@ objc_read_unsigned_short (struct objc_typed_stream *stream,
if (nbytes > (int) sizeof (short)) if (nbytes > (int) sizeof (short))
objc_error (nil, OBJC_ERR_BAD_DATA, objc_error (nil, OBJC_ERR_BAD_DATA,
"expected short, got int or bigger"); "expected short, got int or bigger");
len = (*stream->read) (stream->physical, buf + 1, nbytes); len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
(*value) = 0; (*value) = 0;
while (pos <= nbytes) while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++]; (*value) = ((*value)*0x100) + buf[pos++];
@ -605,12 +609,12 @@ objc_read_unsigned_short (struct objc_typed_stream *stream,
} }
__inline__ int inline int
objc_read_int (struct objc_typed_stream *stream, int *value) objc_read_int (struct objc_typed_stream *stream, int *value)
{ {
unsigned char buf[sizeof (int) + 1]; unsigned char buf[sizeof (int) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
if ((buf[0] & _B_CODE) == _B_SINT) if ((buf[0] & _B_CODE) == _B_SINT)
(*value) = (buf[0] & _B_VALUE); (*value) = (buf[0] & _B_VALUE);
@ -621,7 +625,7 @@ objc_read_int (struct objc_typed_stream *stream, int *value)
int nbytes = buf[0] & _B_NUMBER; int nbytes = buf[0] & _B_NUMBER;
if (nbytes > (int) sizeof (int)) if (nbytes > (int) sizeof (int))
objc_error (nil, OBJC_ERR_BAD_DATA, "expected int, got bigger"); objc_error (nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
len = (*stream->read) (stream->physical, buf + 1, nbytes); len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
(*value) = 0; (*value) = 0;
while (pos <= nbytes) while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++]; (*value) = ((*value)*0x100) + buf[pos++];
@ -632,12 +636,12 @@ objc_read_int (struct objc_typed_stream *stream, int *value)
return len; return len;
} }
__inline__ int inline int
objc_read_long (struct objc_typed_stream *stream, long *value) objc_read_long (struct objc_typed_stream *stream, long *value)
{ {
unsigned char buf[sizeof (long) + 1]; unsigned char buf[sizeof (long) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
if ((buf[0] & _B_CODE) == _B_SINT) if ((buf[0] & _B_CODE) == _B_SINT)
(*value) = (buf[0] & _B_VALUE); (*value) = (buf[0] & _B_VALUE);
@ -648,7 +652,7 @@ objc_read_long (struct objc_typed_stream *stream, long *value)
int nbytes = buf[0] & _B_NUMBER; int nbytes = buf[0] & _B_NUMBER;
if (nbytes > (int) sizeof (long)) if (nbytes > (int) sizeof (long))
objc_error (nil, OBJC_ERR_BAD_DATA, "expected long, got bigger"); objc_error (nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
len = (*stream->read) (stream->physical, buf + 1, nbytes); len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
(*value) = 0; (*value) = 0;
while (pos <= nbytes) while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++]; (*value) = ((*value)*0x100) + buf[pos++];
@ -659,7 +663,7 @@ objc_read_long (struct objc_typed_stream *stream, long *value)
return len; return len;
} }
__inline__ int inline int
__objc_read_nbyte_uint (struct objc_typed_stream *stream, __objc_read_nbyte_uint (struct objc_typed_stream *stream,
unsigned int nbytes, unsigned int *val) unsigned int nbytes, unsigned int *val)
{ {
@ -670,7 +674,7 @@ __objc_read_nbyte_uint (struct objc_typed_stream *stream,
if (nbytes > sizeof (int)) if (nbytes > sizeof (int))
objc_error (nil, OBJC_ERR_BAD_DATA, "expected int, got bigger"); objc_error (nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
len = (*stream->read) (stream->physical, buf, nbytes); len = (*stream->read) (stream->physical, (char*)buf, nbytes);
(*val) = 0; (*val) = 0;
while (pos < nbytes) while (pos < nbytes)
(*val) = ((*val)*0x100) + buf[pos++]; (*val) = ((*val)*0x100) + buf[pos++];
@ -678,13 +682,13 @@ __objc_read_nbyte_uint (struct objc_typed_stream *stream,
} }
__inline__ int inline int
objc_read_unsigned_int (struct objc_typed_stream *stream, objc_read_unsigned_int (struct objc_typed_stream *stream,
unsigned int *value) unsigned int *value)
{ {
unsigned char buf[sizeof (unsigned int) + 1]; unsigned char buf[sizeof (unsigned int) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
if ((buf[0] & _B_CODE) == _B_SINT) if ((buf[0] & _B_CODE) == _B_SINT)
(*value) = (buf[0] & _B_VALUE); (*value) = (buf[0] & _B_VALUE);
@ -707,7 +711,7 @@ __objc_read_nbyte_ulong (struct objc_typed_stream *stream,
if (nbytes > sizeof (long)) if (nbytes > sizeof (long))
objc_error (nil, OBJC_ERR_BAD_DATA, "expected long, got bigger"); objc_error (nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
len = (*stream->read) (stream->physical, buf, nbytes); len = (*stream->read) (stream->physical, (char*)buf, nbytes);
(*val) = 0; (*val) = 0;
while (pos < nbytes) while (pos < nbytes)
(*val) = ((*val)*0x100) + buf[pos++]; (*val) = ((*val)*0x100) + buf[pos++];
@ -715,13 +719,13 @@ __objc_read_nbyte_ulong (struct objc_typed_stream *stream,
} }
__inline__ int inline int
objc_read_unsigned_long (struct objc_typed_stream *stream, objc_read_unsigned_long (struct objc_typed_stream *stream,
unsigned long *value) unsigned long *value)
{ {
unsigned char buf[sizeof (unsigned long) + 1]; unsigned char buf[sizeof (unsigned long) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
if ((buf[0] & _B_CODE) == _B_SINT) if ((buf[0] & _B_CODE) == _B_SINT)
(*value) = (buf[0] & _B_VALUE); (*value) = (buf[0] & _B_VALUE);
@ -733,20 +737,20 @@ objc_read_unsigned_long (struct objc_typed_stream *stream,
return len; return len;
} }
__inline__ int inline int
objc_read_string (struct objc_typed_stream *stream, objc_read_string (struct objc_typed_stream *stream,
char **string) char **string)
{ {
unsigned char buf[sizeof (unsigned int) + 1]; unsigned char buf[sizeof (unsigned int) + 1];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
unsigned long key = 0; unsigned long key = 0;
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
{ {
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
len = (*stream->read) (stream->physical, buf, 1); len = (*stream->read) (stream->physical, (char*)buf, 1);
} }
switch (buf[0]&_B_CODE) { switch (buf[0]&_B_CODE) {
@ -755,7 +759,7 @@ objc_read_string (struct objc_typed_stream *stream,
int length = buf[0]&_B_VALUE; int length = buf[0]&_B_VALUE;
(*string) = (char*)objc_malloc (length + 1); (*string) = (char*)objc_malloc (length + 1);
if (key) if (key)
hash_add (&stream->stream_table, LONG2PTR(key), *string); objc_hash_add (&stream->stream_table, LONG2PTR(key), *string);
len = (*stream->read) (stream->physical, *string, length); len = (*stream->read) (stream->physical, *string, length);
(*string)[length] = '\0'; (*string)[length] = '\0';
} }
@ -765,7 +769,7 @@ objc_read_string (struct objc_typed_stream *stream,
{ {
char *tmp; char *tmp;
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
tmp = hash_value_for_key (stream->stream_table, LONG2PTR (key)); tmp = objc_hash_value_for_key (stream->stream_table, LONG2PTR (key));
*string = objc_malloc (strlen (tmp) + 1); *string = objc_malloc (strlen (tmp) + 1);
strcpy (*string, tmp); strcpy (*string, tmp);
} }
@ -778,7 +782,7 @@ objc_read_string (struct objc_typed_stream *stream,
if (len) { if (len) {
(*string) = (char*)objc_malloc (nbytes + 1); (*string) = (char*)objc_malloc (nbytes + 1);
if (key) if (key)
hash_add (&stream->stream_table, LONG2PTR(key), *string); objc_hash_add (&stream->stream_table, LONG2PTR(key), *string);
len = (*stream->read) (stream->physical, *string, nbytes); len = (*stream->read) (stream->physical, *string, nbytes);
(*string)[nbytes] = '\0'; (*string)[nbytes] = '\0';
} }
@ -800,7 +804,7 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
{ {
unsigned char buf[sizeof (unsigned int)]; unsigned char buf[sizeof (unsigned int)];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
SEL read_sel = sel_get_any_uid ("read:"); SEL read_sel = sel_get_any_uid ("read:");
unsigned long key = 0; unsigned long key = 0;
@ -808,7 +812,7 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register common */ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register common */
{ {
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
len = (*stream->read) (stream->physical, buf, 1); len = (*stream->read) (stream->physical, (char*)buf, 1);
} }
if (buf[0] == (_B_EXT | _BX_OBJECT)) if (buf[0] == (_B_EXT | _BX_OBJECT))
@ -823,14 +827,14 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
/* register? */ /* register? */
if (key) if (key)
hash_add (&stream->object_table, LONG2PTR(key), *object); objc_hash_add (&stream->object_table, LONG2PTR(key), *object);
/* send -read: */ /* send -read: */
if (__objc_responds_to (*object, read_sel)) if (__objc_responds_to (*object, read_sel))
(*get_imp (class, read_sel)) (*object, read_sel, stream); (*get_imp (class, read_sel)) (*object, read_sel, stream);
/* check null-byte */ /* check null-byte */
len = (*stream->read) (stream->physical, buf, 1); len = (*stream->read) (stream->physical, (char*)buf, 1);
if (buf[0] != '\0') if (buf[0] != '\0')
objc_error (nil, OBJC_ERR_BAD_DATA, objc_error (nil, OBJC_ERR_BAD_DATA,
"expected null-byte, got opcode %c", buf[0]); "expected null-byte, got opcode %c", buf[0]);
@ -841,17 +845,19 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
if (key) if (key)
objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode..."); objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
(*object) = hash_value_for_key (stream->object_table, LONG2PTR(key)); (*object) = objc_hash_value_for_key (stream->object_table,
LONG2PTR(key));
} }
else if (buf[0] == (_B_EXT | _BX_OBJREF)) /* a forward reference */ else if (buf[0] == (_B_EXT | _BX_OBJREF)) /* a forward reference */
{ {
struct objc_list *other; struct objc_list *other;
len = objc_read_unsigned_long (stream, &key); len = objc_read_unsigned_long (stream, &key);
other = (struct objc_list *) hash_value_for_key (stream->object_refs, other
= (struct objc_list *) objc_hash_value_for_key (stream->object_refs,
LONG2PTR(key)); LONG2PTR(key));
hash_add (&stream->object_refs, LONG2PTR(key), objc_hash_add (&stream->object_refs, LONG2PTR(key),
(void *)list_cons (object, other)); (void *)list_cons (object, other));
} }
else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */ else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */
@ -875,19 +881,20 @@ objc_read_class (struct objc_typed_stream *stream, Class *class)
{ {
unsigned char buf[sizeof (unsigned int)]; unsigned char buf[sizeof (unsigned int)];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
unsigned long key = 0; unsigned long key = 0;
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
{ {
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
len = (*stream->read) (stream->physical, buf, 1); len = (*stream->read) (stream->physical, (char*)buf, 1);
} }
if (buf[0] == (_B_EXT | _BX_CLASS)) if (buf[0] == (_B_EXT | _BX_CLASS))
{ {
char *class_name; char temp[1] = "";
char *class_name = temp;
unsigned long version; unsigned long version;
/* get class */ /* get class */
@ -897,10 +904,11 @@ objc_read_class (struct objc_typed_stream *stream, Class *class)
/* register */ /* register */
if (key) if (key)
hash_add (&stream->stream_table, LONG2PTR(key), *class); objc_hash_add (&stream->stream_table, LONG2PTR(key), *class);
objc_read_unsigned_long (stream, &version); objc_read_unsigned_long (stream, &version);
hash_add (&stream->class_table, (*class)->name, (void *)version); objc_hash_add (&stream->class_table,
(*class)->name, (void *)version);
} }
else if ((buf[0]&_B_CODE) == _B_UCOMM) else if ((buf[0]&_B_CODE) == _B_UCOMM)
@ -908,7 +916,8 @@ objc_read_class (struct objc_typed_stream *stream, Class *class)
if (key) if (key)
objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode..."); objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
*class = hash_value_for_key (stream->stream_table, LONG2PTR(key)); *class = objc_hash_value_for_key (stream->stream_table,
LONG2PTR(key));
if (! *class) if (! *class)
objc_error (nil, OBJC_ERR_BAD_CLASS, objc_error (nil, OBJC_ERR_BAD_CLASS,
"cannot find class for key %lu", key); "cannot find class for key %lu", key);
@ -926,19 +935,20 @@ objc_read_selector (struct objc_typed_stream *stream, SEL* selector)
{ {
unsigned char buf[sizeof (unsigned int)]; unsigned char buf[sizeof (unsigned int)];
int len; int len;
if ((len = (*stream->read) (stream->physical, buf, 1))) if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{ {
unsigned long key = 0; unsigned long key = 0;
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
{ {
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
len = (*stream->read) (stream->physical, buf, 1); len = (*stream->read) (stream->physical, (char*)buf, 1);
} }
if (buf[0] == (_B_EXT|_BX_SEL)) /* selector! */ if (buf[0] == (_B_EXT|_BX_SEL)) /* selector! */
{ {
char *selector_name; char temp[1] = "";
char *selector_name = temp;
/* get selector */ /* get selector */
len = objc_read_string (stream, &selector_name); len = objc_read_string (stream, &selector_name);
@ -954,7 +964,8 @@ objc_read_selector (struct objc_typed_stream *stream, SEL* selector)
/* register */ /* register */
if (key) if (key)
hash_add (&stream->stream_table, LONG2PTR(key), (void *) *selector); objc_hash_add (&stream->stream_table,
LONG2PTR(key), (void *) *selector);
} }
else if ((buf[0]&_B_CODE) == _B_UCOMM) else if ((buf[0]&_B_CODE) == _B_UCOMM)
@ -962,8 +973,8 @@ objc_read_selector (struct objc_typed_stream *stream, SEL* selector)
if (key) if (key)
objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode..."); objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key); len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
(*selector) = hash_value_for_key (stream->stream_table, (*selector) = objc_hash_value_for_key (stream->stream_table,
LONG2PTR(key)); LONG2PTR(key));
} }
else else
@ -1032,11 +1043,11 @@ objc_write_type (TypedStream *stream, const char *type, const void *data)
case _C_CHARPTR: case _C_CHARPTR:
return objc_write_string (stream, return objc_write_string (stream,
*(char **) data, strlen (*(char **) data)); *(unsigned char **) data, strlen (*(char **) data));
break; break;
case _C_ATOM: case _C_ATOM:
return objc_write_string_atomic (stream, *(char **) data, return objc_write_string_atomic (stream, *(unsigned char **) data,
strlen (*(char **) data)); strlen (*(char **) data));
break; break;
@ -1058,7 +1069,7 @@ objc_write_type (TypedStream *stream, const char *type, const void *data)
while (*type != _C_STRUCT_E) while (*type != _C_STRUCT_E)
{ {
align = objc_alignof_type (type); /* padd to alignment */ align = objc_alignof_type (type); /* padd to alignment */
acc_size += ROUND (acc_size, align); acc_size = ROUND (acc_size, align);
objc_write_type (stream, type, ((char *) data) + acc_size); objc_write_type (stream, type, ((char *) data) + acc_size);
acc_size += objc_sizeof_type (type); /* add component size */ acc_size += objc_sizeof_type (type); /* add component size */
type = objc_skip_typespec (type); /* skip component */ type = objc_skip_typespec (type); /* skip component */
@ -1154,7 +1165,7 @@ objc_read_type(TypedStream *stream, const char *type, void *data)
while (*type != _C_STRUCT_E) while (*type != _C_STRUCT_E)
{ {
align = objc_alignof_type (type); /* padd to alignment */ align = objc_alignof_type (type); /* padd to alignment */
acc_size += ROUND (acc_size, align); acc_size = ROUND (acc_size, align);
objc_read_type (stream, type, ((char*)data)+acc_size); objc_read_type (stream, type, ((char*)data)+acc_size);
acc_size += objc_sizeof_type (type); /* add component size */ acc_size += objc_sizeof_type (type); /* add component size */
type = objc_skip_typespec (type); /* skip component */ type = objc_skip_typespec (type); /* skip component */
@ -1241,15 +1252,15 @@ objc_write_types (TypedStream *stream, const char *type, ...)
case _C_CHARPTR: case _C_CHARPTR:
{ {
char **str = va_arg (args, char **); unsigned char **str = va_arg (args, unsigned char **);
res = objc_write_string (stream, *str, strlen (*str)); res = objc_write_string (stream, *str, strlen ((char*)*str));
} }
break; break;
case _C_ATOM: case _C_ATOM:
{ {
char **str = va_arg (args, char **); unsigned char **str = va_arg (args, unsigned char **);
res = objc_write_string_atomic (stream, *str, strlen (*str)); res = objc_write_string_atomic (stream, *str, strlen ((char*)*str));
} }
break; break;
@ -1473,54 +1484,54 @@ __objc_write_typed_stream_signature (TypedStream *stream)
static void __objc_finish_write_root_object(struct objc_typed_stream *stream) static void __objc_finish_write_root_object(struct objc_typed_stream *stream)
{ {
hash_delete (stream->object_table); objc_hash_delete (stream->object_table);
stream->object_table = hash_new(64, stream->object_table = objc_hash_new (64,
(hash_func_type)hash_ptr, (hash_func_type) objc_hash_ptr,
(compare_func_type)compare_ptrs); (compare_func_type) objc_compare_ptrs);
} }
static void __objc_finish_read_root_object(struct objc_typed_stream *stream) static void __objc_finish_read_root_object(struct objc_typed_stream *stream)
{ {
node_ptr node; node_ptr node;
SEL awake_sel = sel_get_any_uid ("awake"); SEL awake_sel = sel_get_any_uid ("awake");
cache_ptr free_list = hash_new (64, cache_ptr free_list = objc_hash_new (64,
(hash_func_type) hash_ptr, (hash_func_type) objc_hash_ptr,
(compare_func_type) compare_ptrs); (compare_func_type) objc_compare_ptrs);
/* resolve object forward references */ /* resolve object forward references */
for (node = hash_next (stream->object_refs, NULL); node; for (node = objc_hash_next (stream->object_refs, NULL); node;
node = hash_next (stream->object_refs, node)) node = objc_hash_next (stream->object_refs, node))
{ {
struct objc_list *reflist = node->value; struct objc_list *reflist = node->value;
const void *key = node->key; const void *key = node->key;
id object = hash_value_for_key (stream->object_table, key); id object = objc_hash_value_for_key (stream->object_table, key);
while (reflist) while (reflist)
{ {
*((id*) reflist->head) = object; *((id*) reflist->head) = object;
if (hash_value_for_key (free_list,reflist) == NULL) if (objc_hash_value_for_key (free_list,reflist) == NULL)
hash_add (&free_list,reflist,reflist); objc_hash_add (&free_list,reflist,reflist);
reflist = reflist->tail; reflist = reflist->tail;
} }
} }
/* apply __objc_free to all objects stored in free_list */ /* apply __objc_free to all objects stored in free_list */
for (node = hash_next (free_list, NULL); node; for (node = objc_hash_next (free_list, NULL); node;
node = hash_next (free_list, node)) node = objc_hash_next (free_list, node))
objc_free ((void *) node->key); objc_free ((void *) node->key);
hash_delete (free_list); objc_hash_delete (free_list);
/* empty object reference table */ /* empty object reference table */
hash_delete (stream->object_refs); objc_hash_delete (stream->object_refs);
stream->object_refs = hash_new(8, (hash_func_type)hash_ptr, stream->object_refs = objc_hash_new (8, (hash_func_type) objc_hash_ptr,
(compare_func_type)compare_ptrs); (compare_func_type) objc_compare_ptrs);
/* call -awake for all objects read */ /* call -awake for all objects read */
if (awake_sel) if (awake_sel)
{ {
for (node = hash_next (stream->object_table, NULL); node; for (node = objc_hash_next (stream->object_table, NULL); node;
node = hash_next (stream->object_table, node)) node = objc_hash_next (stream->object_table, node))
{ {
id object = node->value; id object = node->value;
if (__objc_responds_to (object, awake_sel)) if (__objc_responds_to (object, awake_sel))
@ -1529,10 +1540,10 @@ static void __objc_finish_read_root_object(struct objc_typed_stream *stream)
} }
/* empty object table */ /* empty object table */
hash_delete (stream->object_table); objc_hash_delete (stream->object_table);
stream->object_table = hash_new(64, stream->object_table = objc_hash_new(64,
(hash_func_type)hash_ptr, (hash_func_type)objc_hash_ptr,
(compare_func_type)compare_ptrs); (compare_func_type)objc_compare_ptrs);
} }
/* /*
@ -1546,21 +1557,22 @@ objc_open_typed_stream (FILE *physical, int mode)
s->mode = mode; s->mode = mode;
s->physical = physical; s->physical = physical;
s->stream_table = hash_new (64, s->stream_table = objc_hash_new (64,
(hash_func_type) hash_ptr, (hash_func_type) objc_hash_ptr,
(compare_func_type) compare_ptrs); (compare_func_type) objc_compare_ptrs);
s->object_table = hash_new (64, s->object_table = objc_hash_new (64,
(hash_func_type) hash_ptr, (hash_func_type) objc_hash_ptr,
(compare_func_type) compare_ptrs); (compare_func_type) objc_compare_ptrs);
s->eof = (objc_typed_eof_func) __objc_feof; s->eof = (objc_typed_eof_func) __objc_feof;
s->flush = (objc_typed_flush_func) fflush; s->flush = (objc_typed_flush_func) fflush;
s->writing_root_p = 0; s->writing_root_p = 0;
if (mode == OBJC_READONLY) if (mode == OBJC_READONLY)
{ {
s->class_table = hash_new (8, (hash_func_type) hash_string, s->class_table
(compare_func_type) compare_strings); = objc_hash_new (8, (hash_func_type) objc_hash_string,
s->object_refs = hash_new (8, (hash_func_type) hash_ptr, (compare_func_type) objc_compare_strings);
(compare_func_type) compare_ptrs); s->object_refs = objc_hash_new (8, (hash_func_type) objc_hash_ptr,
(compare_func_type) objc_compare_ptrs);
s->read = (objc_typed_read_func) __objc_fread; s->read = (objc_typed_read_func) __objc_fread;
s->write = (objc_typed_write_func) __objc_no_write; s->write = (objc_typed_write_func) __objc_no_write;
__objc_read_typed_stream_signature (s); __objc_read_typed_stream_signature (s);
@ -1619,12 +1631,12 @@ objc_close_typed_stream (TypedStream *stream)
if (stream->mode == OBJC_READONLY) if (stream->mode == OBJC_READONLY)
{ {
__objc_finish_read_root_object (stream); /* Just in case... */ __objc_finish_read_root_object (stream); /* Just in case... */
hash_delete (stream->class_table); objc_hash_delete (stream->class_table);
hash_delete (stream->object_refs); objc_hash_delete (stream->object_refs);
} }
hash_delete (stream->stream_table); objc_hash_delete (stream->stream_table);
hash_delete (stream->object_table); objc_hash_delete (stream->object_table);
if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM)) if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM))
fclose ((FILE *)stream->physical); fclose ((FILE *)stream->physical);
@ -1648,7 +1660,8 @@ long
objc_get_stream_class_version (TypedStream *stream, Class class) objc_get_stream_class_version (TypedStream *stream, Class class)
{ {
if (stream->class_table) if (stream->class_table)
return PTR2LONG(hash_value_for_key (stream->class_table, class->name)); return PTR2LONG(objc_hash_value_for_key (stream->class_table,
class->name));
else else
return class_get_version (class); return class_get_version (class);
} }

@ -6,20 +6,20 @@
Lock-free class table code designed and written from scratch by Lock-free class table code designed and written from scratch by
Nicola Pero, 2001. Nicola Pero, 2001.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -88,12 +88,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
classes from the table - and the difficult thing with lock-free data classes from the table - and the difficult thing with lock-free data
structures is freeing data when is removed from the structures. */ structures is freeing data when is removed from the structures. */
#include "runtime.h" /* the kitchen sink */ #include "objc/runtime.h" /* the kitchen sink */
#include "sarray.h" #include "objc/sarray.h"
#include <objc/objc.h> #include "objc/objc.h"
#include <objc/objc-api.h> #include "objc/objc-api.h"
#include <objc/thr.h> #include "objc/thr.h"
/* We use a table which maps a class name to the corresponding class /* We use a table which maps a class name to the corresponding class
* pointer. The first part of this file defines this table, and * pointer. The first part of this file defines this table, and

@ -1,2 +1,58 @@
/* Define this if you have the <sched.h> header file */ /* config.h.in. Generated from configure.ac by autoheader. */
/* Define if the compiler has a thread header that is non single. */
#undef HAVE_GTHR_DEFAULT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <sched.h> header file. */
#undef HAVE_SCHED_H #undef HAVE_SCHED_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define if the compiler is configured for setjmp/longjmp exceptions. */
#undef SJLJ_EXCEPTIONS
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

8337
configure vendored

File diff suppressed because it is too large Load Diff

31
gc.c

@ -2,22 +2,22 @@
Copyright (C) 1998, 2002 Free Software Foundation, Inc. Copyright (C) 1998, 2002 Free Software Foundation, Inc.
Contributed by Ovidiu Predescu. Contributed by Ovidiu Predescu.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -26,31 +26,22 @@ Boston, MA 02111-1307, USA. */
the executable file might be covered by the GNU General Public License. */ the executable file might be covered by the GNU General Public License. */
#include "tconfig.h" #include "tconfig.h"
#include "objc.h" #include "objc/objc.h"
#include "encoding.h" #include "objc/encoding.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#if OBJC_WITH_GC #if OBJC_WITH_GC
#include <gc.h> #include <gc.h>
#include <limits.h>
/* gc_typed.h uses the following but doesn't declare them */ /* gc_typed.h uses the following but doesn't declare them */
typedef GC_word word; typedef GC_word word;
typedef GC_signed_word signed_word; typedef GC_signed_word signed_word;
#define BITS_PER_WORD (CHAR_BIT * sizeof (word))
#if BITS_PER_WORD == 32
# define LOGWL 5
# define modWORDSZ(n) ((n) & 0x1f) /* n mod size of word */
#endif
#if BITS_PER_WORD == 64
# define LOGWL 6
# define modWORDSZ(n) ((n) & 0x3f) /* n mod size of word */
#endif
#define divWORDSZ(n) ((n) >> LOGWL) /* divide n by size of word */
#include <gc_typed.h> #include <gc_typed.h>

@ -2,22 +2,22 @@
Copyright (C) 1997 Free Software Foundation, Inc. Copyright (C) 1997 Free Software Foundation, Inc.
Contributed by Scott Christley <scottc@net-community.com> Contributed by Scott Christley <scottc@net-community.com>
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details. for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to the Free along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable

@ -1,21 +1,21 @@
# GNU Objective C Runtime Makefile for compiling with djgpp # GNU Objective C Runtime Makefile for compiling with djgpp
# Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. # Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
# #
# This file is part of GNU CC. # This file is part of GCC.
# #
# GNU CC is free software; you can redistribute it and/or modify it under the # 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 # terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version. # Foundation; either version 2, or (at your option) any later version.
# #
# GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY # GCC is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details. # details.
# #
# You should have received a copy of the GNU General Public License along with # You should have received a copy of the GNU General Public License along with
# GNU CC; see the file COPYING. If not, write to the Free Software # GCC; see the file COPYING. If not, write to the Free Software
# Foundation, 59 Temple Place - Suite 330, # Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02111-1307, USA. # Boston, MA 02110-1301, USA.
# This Makefile is configured for GnuMAKE # This Makefile is configured for GnuMAKE

@ -3,22 +3,22 @@
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup Contributed by Kresten Krab Thorup
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details. for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to the Free along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA. */
#define __USE_FIXED_PROTOTYPES__ #define __USE_FIXED_PROTOTYPES__
#include <stdlib.h> #include <stdlib.h>
#include "runtime.h" #include "objc/runtime.h"
/* /*
** Error handler function ** Error handler function

@ -2,21 +2,21 @@
Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc. Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup Contributed by Kresten Krab Thorup
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
/* This is the nil method, the function that is called when the receiver /* This is the nil method, the function that is called when the receiver
of a method is nil */ of a method is nil */
#include "runtime.h" #include "objc/runtime.h"
/* When the receiver of a method invocation is nil, the runtime /* When the receiver of a method invocation is nil, the runtime
returns nil_method() as the method implementation. This function returns nil_method() as the method implementation. This function

@ -1,23 +1,23 @@
/* Interface for the NXConstantString class for Objective-C. /* Interface for the NXConstantString class for Objective-C.
Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995, 2004 Free Software Foundation, Inc.
Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl> Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details. License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -28,7 +28,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __nxconstantstring_INCLUDE_GNU #ifndef __nxconstantstring_INCLUDE_GNU
#define __nxconstantstring_INCLUDE_GNU #define __nxconstantstring_INCLUDE_GNU
#include "objc/Object.h" #include "Object.h"
#ifdef __cplusplus
extern "C" {
#endif
@interface NXConstantString: Object @interface NXConstantString: Object
{ {
@ -41,4 +45,8 @@ Boston, MA 02111-1307, USA. */
@end @end
#ifdef __cplusplus
}
#endif
#endif #endif

@ -1,22 +1,22 @@
/* Interface for the Object class for Objective-C. /* Interface for the Object class for Objective-C.
Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details. License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled /* As a special exception, if you link this library with files compiled
with GCC to produce an executable, this does not cause the resulting with GCC to produce an executable, this does not cause the resulting
@ -27,8 +27,12 @@ Boston, MA 02111-1307, USA. */
#ifndef __object_INCLUDE_GNU #ifndef __object_INCLUDE_GNU
#define __object_INCLUDE_GNU #define __object_INCLUDE_GNU
#include <objc/objc.h> #include "objc.h"
#include <objc/typedstream.h> #include "typedstream.h"
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* All classes are derived from Object. As such, * All classes are derived from Object. As such,
@ -121,4 +125,8 @@ Boston, MA 02111-1307, USA. */
@end @end
#ifdef __cplusplus
}
#endif
#endif #endif

@ -1,22 +1,22 @@
/* Declare the class Protocol for Objective C programs. /* Declare the class Protocol for Objective C programs.
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 2004 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -27,7 +27,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __Protocol_INCLUDE_GNU #ifndef __Protocol_INCLUDE_GNU
#define __Protocol_INCLUDE_GNU #define __Protocol_INCLUDE_GNU
#include "objc/Object.h" #include "Object.h"
#ifdef __cplusplus
extern "C" {
#endif
@interface Protocol : Object @interface Protocol : Object
{ {
@ -52,7 +56,8 @@ Boston, MA 02111-1307, USA. */
@end @end
#ifdef __cplusplus
}
#endif
#endif /* not __Protocol_INCLUDE_GNU */ #endif /* not __Protocol_INCLUDE_GNU */

@ -1,24 +1,24 @@
/* Encoding of types for Objective C. /* Encoding of types for Objective C.
Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. Copyright (C) 1993, 1997, 2002, 2004 Free Software Foundation, Inc.
Author: Kresten Krab Thorup Author: Kresten Krab Thorup
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -29,8 +29,12 @@ Boston, MA 02111-1307, USA. */
#ifndef __encoding_INCLUDE_GNU #ifndef __encoding_INCLUDE_GNU
#define __encoding_INCLUDE_GNU #define __encoding_INCLUDE_GNU
#include "objc-api.h"
#include <ctype.h> #include <ctype.h>
#include "objc/objc-api.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define _C_CONST 'r' #define _C_CONST 'r'
#define _C_IN 'n' #define _C_IN 'n'
@ -96,4 +100,8 @@ void objc_layout_structure_get_info (struct objc_struct_layout *layout,
unsigned int *align, unsigned int *align,
const char **type); const char **type);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __encoding_INCLUDE_GNU */ #endif /* __encoding_INCLUDE_GNU */

@ -2,22 +2,22 @@
Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup. Contributed by Kresten Krab Thorup.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -28,6 +28,10 @@ Boston, MA 02111-1307, USA. */
#ifndef __GNU_OBJC_LIST_H #ifndef __GNU_OBJC_LIST_H
#define __GNU_OBJC_LIST_H #define __GNU_OBJC_LIST_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct objc_list { struct objc_list {
void *head; void *head;
struct objc_list *tail; struct objc_list *tail;
@ -64,9 +68,9 @@ list_length(struct objc_list* list)
larger than the list length, NULL is returned */ larger than the list length, NULL is returned */
static inline void* static inline void*
list_nth(int index, struct objc_list* list) list_nth(int indx, struct objc_list* list)
{ {
while(index-- != 0) while(indx-- != 0)
{ {
if(list->tail) if(list->tail)
list = list->tail; list = list->tail;
@ -144,4 +148,9 @@ list_free(struct objc_list* list)
objc_free(list); objc_free(list);
} }
} }
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* not __GNU_OBJC_LIST_H */ #endif /* not __GNU_OBJC_LIST_H */

@ -1,22 +1,22 @@
/* Basic data types for Objective C. /* Basic data types for Objective C.
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -150,7 +150,7 @@ typedef struct objc_protocol {
typedef void* retval_t; /* return value */ typedef void* retval_t; /* return value */
typedef void(*apply_t)(void); /* function pointer */ typedef void(*apply_t)(void); /* function pointer */
typedef union { typedef union arglist {
char *arg_ptr; char *arg_ptr;
char arg_regs[sizeof (char*)]; char arg_regs[sizeof (char*)];
} *arglist_t; /* argument frame */ } *arglist_t; /* argument frame */

@ -1,23 +1,23 @@
/* Sparse Arrays for Objective C dispatch tables /* Sparse Arrays for Objective C dispatch tables
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup. Contributed by Kresten Krab Thorup.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -28,6 +28,8 @@ Boston, MA 02111-1307, USA. */
#ifndef __sarray_INCLUDE_GNU #ifndef __sarray_INCLUDE_GNU
#define __sarray_INCLUDE_GNU #define __sarray_INCLUDE_GNU
#include "thr.h"
#define OBJC_SPARSE2 /* 2-level sparse array */ #define OBJC_SPARSE2 /* 2-level sparse array */
/* #define OBJC_SPARSE3 */ /* 3-level sparse array */ /* #define OBJC_SPARSE3 */ /* 3-level sparse array */
@ -40,16 +42,17 @@ extern const char* __objc_sparse3_id;
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <assert.h>
#include "objc/thr.h" #ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern int nbuckets; /* for stats */ extern int nbuckets; /* for stats */
extern int nindices; extern int nindices;
extern int narrays; extern int narrays;
extern int idxsize; extern int idxsize;
#include <assert.h>
/* An unsigned integer of same size as a pointer */ /* An unsigned integer of same size as a pointer */
#define SIZET_BITS (sizeof(size_t)*8) #define SIZET_BITS (sizeof(size_t)*8)
@ -146,8 +149,8 @@ struct sarray* sarray_new(int, void* default_element);
void sarray_free(struct sarray*); void sarray_free(struct sarray*);
struct sarray* sarray_lazy_copy(struct sarray*); struct sarray* sarray_lazy_copy(struct sarray*);
void sarray_realloc(struct sarray*, int new_size); void sarray_realloc(struct sarray*, int new_size);
void sarray_at_put(struct sarray*, sidx index, void* elem); void sarray_at_put(struct sarray*, sidx indx, void* elem);
void sarray_at_put_safe(struct sarray*, sidx index, void* elem); void sarray_at_put_safe(struct sarray*, sidx indx, void* elem);
struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */ struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
void sarray_remove_garbage(void); void sarray_remove_garbage(void);
@ -156,10 +159,10 @@ void sarray_remove_garbage(void);
#ifdef PRECOMPUTE_SELECTORS #ifdef PRECOMPUTE_SELECTORS
/* Transform soffset values to ints and vica verca */ /* Transform soffset values to ints and vica verca */
static inline unsigned int static inline unsigned int
soffset_decode(sidx index) soffset_decode(sidx indx)
{ {
union sofftype x; union sofftype x;
x.idx = index; x.idx = indx;
#ifdef OBJC_SPARSE3 #ifdef OBJC_SPARSE3
return x.off.eoffset return x.off.eoffset
+ (x.off.boffset*BUCKET_SIZE) + (x.off.boffset*BUCKET_SIZE)
@ -186,9 +189,9 @@ soffset_encode(size_t offset)
#else /* not PRECOMPUTE_SELECTORS */ #else /* not PRECOMPUTE_SELECTORS */
static inline size_t static inline size_t
soffset_decode(sidx index) soffset_decode(sidx indx)
{ {
return index; return indx;
} }
static inline sidx static inline sidx
@ -198,13 +201,13 @@ soffset_encode(size_t offset)
} }
#endif /* not PRECOMPUTE_SELECTORS */ #endif /* not PRECOMPUTE_SELECTORS */
/* Get element from the Sparse array `array' at offset `index' */ /* Get element from the Sparse array `array' at offset `indx' */
static inline void* sarray_get(struct sarray* array, sidx index) static inline void* sarray_get(struct sarray* array, sidx indx)
{ {
#ifdef PRECOMPUTE_SELECTORS #ifdef PRECOMPUTE_SELECTORS
union sofftype x; union sofftype x;
x.idx = index; x.idx = indx;
#ifdef OBJC_SPARSE3 #ifdef OBJC_SPARSE3
return return
array-> array->
@ -217,21 +220,25 @@ static inline void* sarray_get(struct sarray* array, sidx index)
#else /* not PRECOMPUTE_SELECTORS */ #else /* not PRECOMPUTE_SELECTORS */
#ifdef OBJC_SPARSE3 #ifdef OBJC_SPARSE3
return array-> return array->
indices[index/INDEX_CAPACITY]-> indices[indx/INDEX_CAPACITY]->
buckets[(index/BUCKET_SIZE)%INDEX_SIZE]-> buckets[(indx/BUCKET_SIZE)%INDEX_SIZE]->
elems[index%BUCKET_SIZE]; elems[indx%BUCKET_SIZE];
#else /* OBJC_SPARSE2 */ #else /* OBJC_SPARSE2 */
return array->buckets[index/BUCKET_SIZE]->elems[index%BUCKET_SIZE]; return array->buckets[indx/BUCKET_SIZE]->elems[indx%BUCKET_SIZE];
#endif /* not OBJC_SPARSE3 */ #endif /* not OBJC_SPARSE3 */
#endif /* not PRECOMPUTE_SELECTORS */ #endif /* not PRECOMPUTE_SELECTORS */
} }
static inline void* sarray_get_safe(struct sarray* array, sidx index) static inline void* sarray_get_safe(struct sarray* array, sidx indx)
{ {
if(soffset_decode(index) < array->capacity) if(soffset_decode(indx) < array->capacity)
return sarray_get(array, index); return sarray_get(array, indx);
else else
return (array->empty_bucket->elems[0]); return (array->empty_bucket->elems[0]);
} }
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __sarray_INCLUDE_GNU */ #endif /* __sarray_INCLUDE_GNU */

@ -1,32 +1,32 @@
/* Thread and mutex controls for Objective C. /* Thread and mutex controls for Objective C.
Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. Copyright (C) 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU CC is distributed in the hope that it will be useful, GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files /* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause compiled with GCC to produce an executable, this does not cause
@ -38,7 +38,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __thread_INCLUDE_GNU #ifndef __thread_INCLUDE_GNU
#define __thread_INCLUDE_GNU #define __thread_INCLUDE_GNU
#include "objc/objc.h" #include "objc.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/************************************************************************* /*************************************************************************
* Universal static variables: * Universal static variables:
@ -142,4 +146,8 @@ objc_thread_t __objc_thread_id (void);
int __objc_thread_set_data (void *value); int __objc_thread_set_data (void *value);
void * __objc_thread_get_data (void); void * __objc_thread_get_data (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* not __thread_INCLUDE_GNU */ #endif /* not __thread_INCLUDE_GNU */

@ -1,22 +1,22 @@
/* GNU Objective-C Typed Streams interface. /* GNU Objective-C Typed Streams interface.
Copyright (C) 1993, 1995 Free Software Foundation, Inc. Copyright (C) 1993, 1995, 2004 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details. License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled /* As a special exception, if you link this library with files compiled
with GCC to produce an executable, this does not cause the resulting with GCC to produce an executable, this does not cause the resulting
@ -27,10 +27,15 @@ Boston, MA 02111-1307, USA. */
#ifndef __typedstream_INCLUDE_GNU #ifndef __typedstream_INCLUDE_GNU
#define __typedstream_INCLUDE_GNU #define __typedstream_INCLUDE_GNU
#include "objc/objc.h" #include "objc.h"
#include "objc/hash.h" #include "hash.h"
#include <stdio.h> #include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef int (*objc_typed_read_func)(void*, char*, int); typedef int (*objc_typed_read_func)(void*, char*, int);
typedef int (*objc_typed_write_func)(void*, const char*, int); typedef int (*objc_typed_write_func)(void*, const char*, int);
typedef int (*objc_typed_flush_func)(void*); typedef int (*objc_typed_flush_func)(void*);
@ -99,7 +104,7 @@ int objc_read_types (TypedStream* stream, const char* type, ...);
int objc_write_object_reference (TypedStream* stream, id object); int objc_write_object_reference (TypedStream* stream, id object);
int objc_write_root_object (TypedStream* stream, id object); int objc_write_root_object (TypedStream* stream, id object);
long objc_get_stream_class_version (TypedStream* stream, Class class); long objc_get_stream_class_version (TypedStream* stream, Class class_type);
/* /*
@ -129,4 +134,8 @@ void objc_close_typed_stream (TypedStream* stream);
BOOL objc_end_of_typed_stream (TypedStream* stream); BOOL objc_end_of_typed_stream (TypedStream* stream);
void objc_flush_typed_stream (TypedStream* stream); void objc_flush_typed_stream (TypedStream* stream);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* not __typedstream_INCLUDE_GNU */ #endif /* not __typedstream_INCLUDE_GNU */

@ -2,21 +2,21 @@
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup Contributed by Kresten Krab Thorup
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include "tconfig.h" /* include defs of bzero for target */ #include "tconfig.h" /* include defs of bzero for target */
#include "objc.h" #include "objc/objc.h"
#include "runtime.h" /* the kitchen sink */ #include "objc/runtime.h" /* the kitchen sink */
#if OBJC_WITH_GC #if OBJC_WITH_GC
# include <gc.h> # include <gc.h>

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <pthread.h> #include <pthread.h>
#include <thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */ /* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage; static pthread_key_t _objc_thread_storage;

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <pthread.h> #include <pthread.h>
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */ /* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage; static pthread_key_t _objc_thread_storage;

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -29,8 +29,8 @@ Boston, MA 02111-1307, USA. */
#include <sys/sysmp.h> #include <sys/sysmp.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <ulocks.h> #include <ulocks.h>
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */ /* Key structure for maintaining thread specific storage */
static void * __objc_shared_arena_handle = NULL; static void * __objc_shared_arena_handle = NULL;

@ -1,21 +1,21 @@
/* GNU Objective C Runtime Thread Interface. /* GNU Objective C Runtime Thread Interface.
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -24,12 +24,17 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#define _LIBOBJC #define _LIBOBJC
/* The line below is needed for declarations of functions such as
pthread_mutexattr_settype, without which gthr-posix.h may fail to
compile within libobjc. */
#define _XOPEN_SOURCE 500
#include "config.h"
#include "tconfig.h" #include "tconfig.h"
#include "coretypes.h" #include "coretypes.h"
#include "tm.h" #include "tm.h"
#include "defaults.h" #include "defaults.h"
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
#include <gthr.h> #include <gthr.h>
/* Backend initialization functions */ /* Backend initialization functions */

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Thomas Baier (baier@ci.tuwien.ac.at) Contributed by Thomas Baier (baier@ci.tuwien.ac.at)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
#define INCL_DOSSEMAPHORES #define INCL_DOSSEMAPHORES
#define INCL_DOSPROCESS #define INCL_DOSPROCESS

@ -3,21 +3,21 @@
Contributed by Scott Christley <scottc@net-community.com> Contributed by Scott Christley <scottc@net-community.com>
Condition functions added by: Mircea Oancea <mircea@first.elcom.pub.ro> Condition functions added by: Mircea Oancea <mircea@first.elcom.pub.ro>
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -26,8 +26,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <pcthread.h> #include <pcthread.h>
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */ /* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage; static pthread_key_t _objc_thread_storage;

@ -4,21 +4,21 @@
Renamed from thr-vxworks.c to thr-rtems.c by Renamed from thr-vxworks.c to thr-rtems.c by
Ralf Corsepius (corsepiu@faw.uni-ulm.de) Ralf Corsepius (corsepiu@faw.uni-ulm.de)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -26,8 +26,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Thread local storage for a single thread */ /* Thread local storage for a single thread */
static void *thread_local_storage = NULL; static void *thread_local_storage = NULL;

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Thread local storage for a single thread */ /* Thread local storage for a single thread */
static void *thread_local_storage = NULL; static void *thread_local_storage = NULL;

@ -3,21 +3,21 @@
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
Conditions added by Mircea Oancea (mircea@first.elcom.pub.ro) Conditions added by Mircea Oancea (mircea@first.elcom.pub.ro)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
#include <thread.h> #include <thread.h>
#include <synch.h> #include <synch.h>

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <objc/thr.h> #include "objc/thr.h"
#include "runtime.h" #include "objc/runtime.h"
/* Thread local storage for a single thread */ /* Thread local storage for a single thread */
static void *thread_local_storage = NULL; static void *thread_local_storage = NULL;

18
thr.c

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
This file is part of GNU CC. This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify it under the 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 terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version. Foundation; either version 2, or (at your option) any later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
GNU CC; see the file COPYING. If not, write to the Free Software GCC; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02111-1307, USA. */ Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled with /* As a special exception, if you link this library with files compiled with
GCC to produce an executable, this does not cause the resulting executable GCC to produce an executable, this does not cause the resulting executable
@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */ covered by the GNU General Public License. */
#include <stdlib.h> #include <stdlib.h>
#include "runtime.h" #include "objc/runtime.h"
/* Global exit status. */ /* Global exit status. */
int __objc_thread_exit_status = 0; int __objc_thread_exit_status = 0;
@ -75,8 +75,8 @@ struct __objc_thread_start_state
id argument; id argument;
}; };
static volatile void static void __attribute__((noreturn))
__objc_thread_detach_function (struct __objc_thread_start_state *istate) __objc_thread_detach_function (struct __objc_thread_start_state *istate)
{ {
/* Valid state? */ /* Valid state? */
if (istate) { if (istate) {

Loading…
Cancel
Save