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.
#Copyright (C) 1993, 95-98, 1999, 2001 Free Software Foundation, Inc.
# Makefile for GNU Objective C runtime library.
# 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
#the Free Software Foundation; either version 2, or (at your option)
#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
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#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 Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA. */
#along with GCC; see the file COPYING. If not, write to
#the Free Software Foundation, 51 Franklin Street, Fifth Floor,
#Boston, MA 02110-1301, USA. */
#This was cribbed from the libchill, libiberty and libstdc++
#Makefile.in files. Some of this stuff may be unnecessary and
@ -31,19 +32,24 @@ srcdir = @glibcpp_srcdir@
VPATH = @glibcpp_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
target_alias = @target_alias@
gcc_version = @gcc_version@
gcc_version_trigger = @gcc_version_trigger@
target_noncanonical = @target_noncanonical@
gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
host_subdir = @host_subdir@
top_srcdir = @top_srcdir@
toplevel_srcdir = @toplevel_srcdir@
toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
toolexecdir = @toolexecdir@
# Toolexecdir is used only by toolexeclibdir
toolexeclibdir = @toolexeclibdir@
includedirname = @includedirname@
libext = @libext@
extra_ldflags_libobjc = @extra_ldflags_libobjc@
top_builddir = .
libdir = $(exec_prefix)/lib
libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
# Multilib support variables.
MULTISRCTOP =
@ -68,35 +74,26 @@ RANLIB = @RANLIB@
CC = @CC@
CFLAGS = @CFLAGS@
WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
GTHREAD_FLAGS=@GTHREAD_FLAGS@
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
# The following strings describe the version of the obj-C library
# begin compiled and compatibility issues.
# Please refer to Libtool documentation about how to manage these
# numbers.
LIBOBJC_VERSION = 1:0:0
LIBOBJC_GC_VERSION = 1:0:0
# @LIBTOOL@ does not get it right, so we hack it in - FIXME
LIBTOOL = ./libtool
LIBOBJC_VERSION = @VERSION@
LIBOBJC_GC_VERSION = @VERSION@
LIBTOOL = @LIBTOOL@
LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
LIBTOOL_LINK = $(LIBTOOL) --mode=link
LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean
#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 \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config -I$(MULTIBUILDTOP)../../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config \
-I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
-I$(srcdir)/$(MULTISRCTOP)../include
OBJC_GCFLAGS=-DOBJC_WITH_GC=1
@ -137,33 +134,33 @@ FLAGS_TO_PASS = \
"libsubdir=$(libsubdir)" \
"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
# User-visible header files.
OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \
NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \
thr.h
thr.h objc-decls.h
# Modules that comprise the runtime library.
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 \
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 \
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 \
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:
echo "" > tmp-runtime
echo "" > tmp-runtime.m
echo "/* This file is automatically generated */" > $@
$(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@
rm -f tmp-runtime
$(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@
rm -f tmp-runtime.m tmp-runtime.s
archive_gc.lo: archive.c
$(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) \
$(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
libobjc.la: $(OBJS)
libobjc$(libext).la: $(OBJS)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
-rpath $(glibcpp_toolexeclibdir) \
-version-info $(LIBOBJC_VERSION)
-rpath $(toolexeclibdir) \
-version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc)
libobjc_gc.la: $(OBJS_GC)
libobjc_gc$(libext).la: $(OBJS_GC)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \
-rpath $(glibcpp_toolexeclibdir) \
-version-info $(LIBOBJC_GC_VERSION)
-rpath $(toolexeclibdir) \
-version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc)
#
# 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)' \
CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
${srcdir}/configure: configure.in
${srcdir}/configure: @MAINT@ configure.ac
rm -f config.cache
cd ${srcdir} && autoconf
install: install-libs install-headers
install-libs: installdirs
$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(glibcpp_toolexeclibdir)
$(LIBTOOL_INSTALL) $(INSTALL) libobjc.la $(DESTDIR)$(glibcpp_toolexeclibdir);
$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
$(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir);
if [ "$(OBJC_BOEHM_GC)" ]; then \
$(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc.la \
$(DESTDIR)$(glibcpp_toolexeclibdir);\
$(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \
$(DESTDIR)$(toolexeclibdir);\
fi
$(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.
install-headers:
$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/include/objc
$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
for file in $(OBJC_H); do \
realfile=$(srcdir)/objc/$${file}; \
$(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/include/objc; \
$(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
done
check uninstall install-strip dist installcheck installdirs:
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 \
fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \
*.toc *.tp *.vr *.html libobj.exp
@ -357,3 +362,7 @@ maintainer-clean realclean: distclean
.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
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.
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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause

@ -1,22 +1,22 @@
/* The implementation of class Object for Objective-C.
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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled
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.
+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
===========
This method, if defined, is called before any other instance or class
methods of that particular class. This method is not inherited, and
is thus not called as initializer for a subclass that doesn't define
it itself. Thus, each +initialize method is called exactly once (or
never if no methods of that particular class is never called).
Besides this, it is allowed to have several +initialize methods, one
for each category. The order in which these (multiple methods) are
called is not well defined. I am not completely certain what the
semantics of this method is for other implementations, but this is
how it works for GNU Objective C.
methods of that particular class. For the GNU runtime, this method is
not inherited, and is thus not called as initializer for a subclass that
doesn't define it itself. Thus, each +initialize method is called exactly
once by the runtime (or never if no methods of that particular class is
never called). It is wise to guard against multiple invocations anyway
to remain portable with the NeXT runtime. The runtime invocation of
this method is thread safe.
Passivation/Activation/Typedstreams

418
aclocal.m4 vendored

@ -1,231 +1,201 @@
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
dnl
dnl Initialize configure bits.
dnl
dnl GLIBCPP_TOPREL_CONFIGURE
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
dnl Default to --enable-multilib
AC_ARG_ENABLE(multilib,
[ --enable-multilib build hella library versions (default)],
[case "${enableval}" in
yes) multilib=yes ;;
no) multilib=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [multilib=yes])dnl
# When building with srcdir == objdir, links to the source files will
# be created in directories within the target_subdir. We have to
# adjust toplevel_srcdir accordingly, so that configure finds
# install-sh and other auxiliary files that live in the top-level
# source directory.
if test "${srcdir}" = "."; then
if test -z "${with_target_subdir}"; then
toprel=".."
else
if test "${with_target_subdir}" != "."; then
toprel="${with_multisrctop}../.."
else
toprel="${with_multisrctop}.."
fi
fi
else
toprel=".."
fi
AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
toplevel_srcdir=\${top_srcdir}/$toprel
AC_SUBST(toplevel_srcdir)
# generated automatically by aclocal 1.9.3 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# AM_AUX_DIR_EXPAND
# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 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.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $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
dnl Initialize configure bits.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
# Export build and source directories.
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
glibcpp_builddir=`${PWDCMD-pwd}`
case $srcdir in
[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
AC_SUBST(glibcpp_builddir)
AC_SUBST(glibcpp_srcdir)
dnl This is here just to satisfy automake.
ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
# be 'cp -p' if linking isn't available.
#ac_cv_prog_LN_S='cp -p'
AC_PROG_LN_S
# We use these options to decide which functions to include.
AC_ARG_WITH(target-subdir,
[ --with-target-subdir=SUBDIR
configuring in a subdirectory])
AC_ARG_WITH(cross-host,
[ --with-cross-host=HOST configuring with a cross compiler])
# Never versions of autoconf add an underscore to these functions.
# 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
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 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.
# serial 6
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
$1_TRUE='#'
$1_FALSE=
fi
])
LIB_AC_PROG_CC
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
AC_PROG_INSTALL
# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
# at least currently, we never actually build a program, so we never
# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
# fails, because we are probably configuring with a cross compiler
# which can't create executables. So we include AC_EXEEXT to keep
# automake happy, but we don't execute it, since we don't care about
# the result.
if false; then
# autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
# to nothing, so nothing would remain between `then' and `fi' if it
# were not for the `:' below.
:
AC_EXEEXT
fi
])
dnl
dnl GLIBCPP_EXPORT_INSTALL_INFO
dnl calculates gxx_install_dir
dnl exports glibcpp_toolexecdir
dnl exports glibcpp_toolexeclibdir
dnl exports glibcpp_prefixdir
dnl
dnl Assumes cross_compiling bits already done, and with_cross_host in
dnl particular
dnl
dnl GLIBCPP_EXPORT_INSTALL_INFO
AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
# Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
# exported correctly in GLIBCPP_CONFIGURE.
glibcpp_toolexecdir=no
glibcpp_toolexeclibdir=no
glibcpp_prefixdir=${prefix}
AC_MSG_CHECKING([for interface version number])
libstdcxx_interface=$INTERFACE
AC_MSG_RESULT($libstdcxx_interface)
# Process the option "--enable-version-specific-runtime-libs"
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
[case "$enableval" in
yes) version_specific_libs=yes ;;
no) version_specific_libs=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
esac],
version_specific_libs=no)dnl
# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs)
gcc_version_trigger=${srcdir}/../gcc/version.c
gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
AC_SUBST(gcc_version)
AC_SUBST(gcc_version_trigger)
if test $version_specific_libs = yes; then
# Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option
# is selected.
changequote(,)dnl
glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
changequote([,])dnl
fi
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
# Install a library built with a cross compiler in tooldir, not libdir.
if test x"$glibcpp_toolexecdir" = x"no"; then
if test -n "$with_cross_host" &&
test x"$with_cross_host" != x"no"; then
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
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`
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 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.
# serial 3
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# serial 2
# AM_PROG_CC_C_O
# --------------
# Like AC_PROG_CC_C_O, but changed for automake.
# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 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.
AC_DEFUN([AM_PROG_CC_C_O],
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
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
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
AC_SUBST(glibcpp_prefixdir)
AC_SUBST(glibcpp_toolexecdir)
AC_SUBST(glibcpp_toolexeclibdir)
])
sinclude(../libtool.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])
])
m4_include([acinclude.m4])

@ -1,22 +1,22 @@
/* 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
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -25,9 +25,9 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#include "tconfig.h"
#include "runtime.h"
#include "typedstream.h"
#include "encoding.h"
#include "objc/runtime.h"
#include "objc/typedstream.h"
#include "objc/encoding.h"
#include <stdlib.h>
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_read_root_object (struct objc_typed_stream *);
static __inline__ int
static inline int
__objc_code_unsigned_char (unsigned char *buf, unsigned char 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];
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)
{
if (val >= 0)
@ -105,10 +105,10 @@ objc_write_char (struct objc_typed_stream *stream, signed char value)
{
unsigned char buf[sizeof (char) + 1];
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)
{
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];
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)
{
int sign = (val < 0);
@ -161,11 +161,11 @@ objc_write_short (struct objc_typed_stream *stream, short value)
{
unsigned char buf[sizeof (short) + 1];
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)
{
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];
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)
{
int sign = (val < 0);
@ -217,10 +217,10 @@ objc_write_int (struct objc_typed_stream *stream, int value)
{
unsigned char buf[sizeof (int) + 1];
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)
{
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];
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)
{
int sign = (val < 0);
@ -273,7 +273,7 @@ objc_write_long (struct objc_typed_stream *stream, long value)
{
unsigned char buf[sizeof (long) + 1];
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 */
buf[0] = (buf[0]&_B_VALUE)|_B_NSTR;
if ((*stream->write) (stream->physical, buf, len) != 0)
return (*stream->write) (stream->physical, string, nbytes);
if ((*stream->write) (stream->physical, (char*)buf, len) != 0)
return (*stream->write) (stream->physical, (char*)string, nbytes);
else
return 0;
}
@ -301,12 +301,13 @@ objc_write_string_atomic (struct objc_typed_stream *stream,
unsigned char *string, unsigned int nbytes)
{
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);
else
{
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)))
return objc_write_string (stream, string, nbytes);
return length;
@ -323,12 +324,12 @@ objc_write_register_common (struct objc_typed_stream *stream,
{
buf[0] = _B_RCOMM|0x01;
buf[1] &= _B_VALUE;
return (*stream->write) (stream->physical, buf, len + 1);
return (*stream->write) (stream->physical, (char*)buf, len + 1);
}
else
{
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[1] &= _B_VALUE;
return (*stream->write) (stream->physical, buf, 2);
return (*stream->write) (stream->physical, (char*)buf, 2);
}
else
{
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)
{
if (code <= _B_VALUE)
{
unsigned char buf = code|_B_EXT;
return (*stream->write) (stream->physical, &buf, 1);
return (*stream->write) (stream->physical, (char*)&buf, 1);
}
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)
{
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_class (stream, object->class_pointer);
(*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
return objc_write_use_common (stream, 0);
@ -386,7 +387,7 @@ int
objc_write_object_reference (struct objc_typed_stream *stream, id object)
{
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);
__objc_write_extension (stream, _BX_OBJREF);
@ -415,7 +416,7 @@ int
objc_write_object (struct objc_typed_stream *stream, id object)
{
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);
else if (object == nil)
@ -424,18 +425,19 @@ objc_write_object (struct objc_typed_stream *stream, id object)
else
{
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)))
return __objc_write_object (stream, object);
return length;
}
}
__inline__ int
inline int
__objc_write_class (struct objc_typed_stream *stream, struct objc_class *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));
return objc_write_unsigned_long (stream, class->version);
}
@ -446,12 +448,13 @@ objc_write_class (struct objc_typed_stream *stream,
struct objc_class *class)
{
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);
else
{
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)))
return __objc_write_class (stream, class);
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)
{
const char *sel_name;
__objc_write_extension (stream, _BX_SEL);
/* to handle NULL selectors */
if ((SEL)0 == selector)
return objc_write_string (stream, "", 0);
return objc_write_string (stream, (unsigned char*)"", 0);
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
@ -482,12 +485,13 @@ objc_write_selector (struct objc_typed_stream *stream, SEL selector)
return __objc_write_selector (stream, 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);
else
{
int length;
hash_add (&stream->stream_table,
objc_hash_add (&stream->stream_table,
LONG2PTR(key = PTR2LONG(sel_name)), (char *) sel_name);
if ((length = objc_write_register_common (stream, key)))
return __objc_write_selector (stream, selector);
@ -501,12 +505,12 @@ objc_write_selector (struct objc_typed_stream *stream, SEL selector)
** Read operations
*/
__inline__ int
inline int
objc_read_char (struct objc_typed_stream *stream, char *val)
{
unsigned char buf;
int len;
len = (*stream->read) (stream->physical, &buf, 1);
len = (*stream->read) (stream->physical, (char*)&buf, 1);
if (len != 0)
{
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)
{
unsigned char buf;
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)
(*val) = (buf & _B_VALUE);
else if ((buf & _B_NUMBER) == 1)
len = (*stream->read) (stream->physical, val, 1);
len = (*stream->read) (stream->physical, (char*)val, 1);
else
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;
}
__inline__ int
inline int
objc_read_short (struct objc_typed_stream *stream, short *value)
{
unsigned char buf[sizeof (short) + 1];
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)
(*value) = (buf[0] & _B_VALUE);
@ -566,7 +570,7 @@ objc_read_short (struct objc_typed_stream *stream, short *value)
if (nbytes > (int) sizeof (short))
objc_error (nil, OBJC_ERR_BAD_DATA,
"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;
while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++];
@ -577,13 +581,13 @@ objc_read_short (struct objc_typed_stream *stream, short *value)
return len;
}
__inline__ int
inline int
objc_read_unsigned_short (struct objc_typed_stream *stream,
unsigned short *value)
{
unsigned char buf[sizeof (unsigned short) + 1];
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)
(*value) = (buf[0] & _B_VALUE);
@ -595,7 +599,7 @@ objc_read_unsigned_short (struct objc_typed_stream *stream,
if (nbytes > (int) sizeof (short))
objc_error (nil, OBJC_ERR_BAD_DATA,
"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;
while (pos <= nbytes)
(*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)
{
unsigned char buf[sizeof (int) + 1];
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)
(*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;
if (nbytes > (int) sizeof (int))
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;
while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++];
@ -632,12 +636,12 @@ objc_read_int (struct objc_typed_stream *stream, int *value)
return len;
}
__inline__ int
inline int
objc_read_long (struct objc_typed_stream *stream, long *value)
{
unsigned char buf[sizeof (long) + 1];
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)
(*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;
if (nbytes > (int) sizeof (long))
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;
while (pos <= nbytes)
(*value) = ((*value)*0x100) + buf[pos++];
@ -659,7 +663,7 @@ objc_read_long (struct objc_typed_stream *stream, long *value)
return len;
}
__inline__ int
inline int
__objc_read_nbyte_uint (struct objc_typed_stream *stream,
unsigned int nbytes, unsigned int *val)
{
@ -670,7 +674,7 @@ __objc_read_nbyte_uint (struct objc_typed_stream *stream,
if (nbytes > sizeof (int))
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;
while (pos < nbytes)
(*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,
unsigned int *value)
{
unsigned char buf[sizeof (unsigned int) + 1];
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)
(*value) = (buf[0] & _B_VALUE);
@ -707,7 +711,7 @@ __objc_read_nbyte_ulong (struct objc_typed_stream *stream,
if (nbytes > sizeof (long))
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;
while (pos < nbytes)
(*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,
unsigned long *value)
{
unsigned char buf[sizeof (unsigned long) + 1];
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)
(*value) = (buf[0] & _B_VALUE);
@ -733,20 +737,20 @@ objc_read_unsigned_long (struct objc_typed_stream *stream,
return len;
}
__inline__ int
inline int
objc_read_string (struct objc_typed_stream *stream,
char **string)
{
unsigned char buf[sizeof (unsigned int) + 1];
int len;
if ((len = (*stream->read) (stream->physical, buf, 1)))
if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{
unsigned long key = 0;
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
{
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) {
@ -755,7 +759,7 @@ objc_read_string (struct objc_typed_stream *stream,
int length = buf[0]&_B_VALUE;
(*string) = (char*)objc_malloc (length + 1);
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);
(*string)[length] = '\0';
}
@ -765,7 +769,7 @@ objc_read_string (struct objc_typed_stream *stream,
{
char *tmp;
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);
strcpy (*string, tmp);
}
@ -778,7 +782,7 @@ objc_read_string (struct objc_typed_stream *stream,
if (len) {
(*string) = (char*)objc_malloc (nbytes + 1);
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);
(*string)[nbytes] = '\0';
}
@ -800,7 +804,7 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
{
unsigned char buf[sizeof (unsigned int)];
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:");
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 */
{
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))
@ -823,14 +827,14 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
/* register? */
if (key)
hash_add (&stream->object_table, LONG2PTR(key), *object);
objc_hash_add (&stream->object_table, LONG2PTR(key), *object);
/* send -read: */
if (__objc_responds_to (*object, read_sel))
(*get_imp (class, read_sel)) (*object, read_sel, stream);
/* check null-byte */
len = (*stream->read) (stream->physical, buf, 1);
len = (*stream->read) (stream->physical, (char*)buf, 1);
if (buf[0] != '\0')
objc_error (nil, OBJC_ERR_BAD_DATA,
"expected null-byte, got opcode %c", buf[0]);
@ -841,17 +845,19 @@ objc_read_object (struct objc_typed_stream *stream, id *object)
if (key)
objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
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 */
{
struct objc_list *other;
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));
hash_add (&stream->object_refs, LONG2PTR(key),
(void *)list_cons (object, other));
objc_hash_add (&stream->object_refs, LONG2PTR(key),
(void *)list_cons (object, other));
}
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)];
int len;
if ((len = (*stream->read) (stream->physical, buf, 1)))
if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{
unsigned long key = 0;
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
{
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))
{
char *class_name;
char temp[1] = "";
char *class_name = temp;
unsigned long version;
/* get class */
@ -897,10 +904,11 @@ objc_read_class (struct objc_typed_stream *stream, Class *class)
/* register */
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);
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)
@ -908,7 +916,8 @@ objc_read_class (struct objc_typed_stream *stream, Class *class)
if (key)
objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
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)
objc_error (nil, OBJC_ERR_BAD_CLASS,
"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)];
int len;
if ((len = (*stream->read) (stream->physical, buf, 1)))
if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
{
unsigned long key = 0;
if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
{
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! */
{
char *selector_name;
char temp[1] = "";
char *selector_name = temp;
/* get selector */
len = objc_read_string (stream, &selector_name);
@ -954,7 +964,8 @@ objc_read_selector (struct objc_typed_stream *stream, SEL* selector)
/* register */
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)
@ -962,8 +973,8 @@ objc_read_selector (struct objc_typed_stream *stream, SEL* selector)
if (key)
objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
(*selector) = hash_value_for_key (stream->stream_table,
LONG2PTR(key));
(*selector) = objc_hash_value_for_key (stream->stream_table,
LONG2PTR(key));
}
else
@ -1032,11 +1043,11 @@ objc_write_type (TypedStream *stream, const char *type, const void *data)
case _C_CHARPTR:
return objc_write_string (stream,
*(char **) data, strlen (*(char **) data));
*(unsigned char **) data, strlen (*(char **) data));
break;
case _C_ATOM:
return objc_write_string_atomic (stream, *(char **) data,
return objc_write_string_atomic (stream, *(unsigned char **) data,
strlen (*(char **) data));
break;
@ -1058,7 +1069,7 @@ objc_write_type (TypedStream *stream, const char *type, const void *data)
while (*type != _C_STRUCT_E)
{
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);
acc_size += objc_sizeof_type (type); /* add component size */
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)
{
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);
acc_size += objc_sizeof_type (type); /* add component size */
type = objc_skip_typespec (type); /* skip component */
@ -1241,15 +1252,15 @@ objc_write_types (TypedStream *stream, const char *type, ...)
case _C_CHARPTR:
{
char **str = va_arg (args, char **);
res = objc_write_string (stream, *str, strlen (*str));
unsigned char **str = va_arg (args, unsigned char **);
res = objc_write_string (stream, *str, strlen ((char*)*str));
}
break;
case _C_ATOM:
{
char **str = va_arg (args, char **);
res = objc_write_string_atomic (stream, *str, strlen (*str));
unsigned char **str = va_arg (args, unsigned char **);
res = objc_write_string_atomic (stream, *str, strlen ((char*)*str));
}
break;
@ -1473,54 +1484,54 @@ __objc_write_typed_stream_signature (TypedStream *stream)
static void __objc_finish_write_root_object(struct objc_typed_stream *stream)
{
hash_delete (stream->object_table);
stream->object_table = hash_new(64,
(hash_func_type)hash_ptr,
(compare_func_type)compare_ptrs);
objc_hash_delete (stream->object_table);
stream->object_table = objc_hash_new (64,
(hash_func_type) objc_hash_ptr,
(compare_func_type) objc_compare_ptrs);
}
static void __objc_finish_read_root_object(struct objc_typed_stream *stream)
{
node_ptr node;
SEL awake_sel = sel_get_any_uid ("awake");
cache_ptr free_list = hash_new (64,
(hash_func_type) hash_ptr,
(compare_func_type) compare_ptrs);
cache_ptr free_list = objc_hash_new (64,
(hash_func_type) objc_hash_ptr,
(compare_func_type) objc_compare_ptrs);
/* resolve object forward references */
for (node = hash_next (stream->object_refs, NULL); node;
node = hash_next (stream->object_refs, node))
for (node = objc_hash_next (stream->object_refs, NULL); node;
node = objc_hash_next (stream->object_refs, node))
{
struct objc_list *reflist = node->value;
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)
{
*((id*) reflist->head) = object;
if (hash_value_for_key (free_list,reflist) == NULL)
hash_add (&free_list,reflist,reflist);
if (objc_hash_value_for_key (free_list,reflist) == NULL)
objc_hash_add (&free_list,reflist,reflist);
reflist = reflist->tail;
}
}
/* apply __objc_free to all objects stored in free_list */
for (node = hash_next (free_list, NULL); node;
node = hash_next (free_list, node))
for (node = objc_hash_next (free_list, NULL); node;
node = objc_hash_next (free_list, node))
objc_free ((void *) node->key);
hash_delete (free_list);
objc_hash_delete (free_list);
/* empty object reference table */
hash_delete (stream->object_refs);
stream->object_refs = hash_new(8, (hash_func_type)hash_ptr,
(compare_func_type)compare_ptrs);
objc_hash_delete (stream->object_refs);
stream->object_refs = objc_hash_new (8, (hash_func_type) objc_hash_ptr,
(compare_func_type) objc_compare_ptrs);
/* call -awake for all objects read */
if (awake_sel)
{
for (node = hash_next (stream->object_table, NULL); node;
node = hash_next (stream->object_table, node))
for (node = objc_hash_next (stream->object_table, NULL); node;
node = objc_hash_next (stream->object_table, node))
{
id object = node->value;
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 */
hash_delete (stream->object_table);
stream->object_table = hash_new(64,
(hash_func_type)hash_ptr,
(compare_func_type)compare_ptrs);
objc_hash_delete (stream->object_table);
stream->object_table = objc_hash_new(64,
(hash_func_type)objc_hash_ptr,
(compare_func_type)objc_compare_ptrs);
}
/*
@ -1546,21 +1557,22 @@ objc_open_typed_stream (FILE *physical, int mode)
s->mode = mode;
s->physical = physical;
s->stream_table = hash_new (64,
(hash_func_type) hash_ptr,
(compare_func_type) compare_ptrs);
s->object_table = hash_new (64,
(hash_func_type) hash_ptr,
(compare_func_type) compare_ptrs);
s->stream_table = objc_hash_new (64,
(hash_func_type) objc_hash_ptr,
(compare_func_type) objc_compare_ptrs);
s->object_table = objc_hash_new (64,
(hash_func_type) objc_hash_ptr,
(compare_func_type) objc_compare_ptrs);
s->eof = (objc_typed_eof_func) __objc_feof;
s->flush = (objc_typed_flush_func) fflush;
s->writing_root_p = 0;
if (mode == OBJC_READONLY)
{
s->class_table = hash_new (8, (hash_func_type) hash_string,
(compare_func_type) compare_strings);
s->object_refs = hash_new (8, (hash_func_type) hash_ptr,
(compare_func_type) compare_ptrs);
s->class_table
= objc_hash_new (8, (hash_func_type) objc_hash_string,
(compare_func_type) objc_compare_strings);
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->write = (objc_typed_write_func) __objc_no_write;
__objc_read_typed_stream_signature (s);
@ -1619,12 +1631,12 @@ objc_close_typed_stream (TypedStream *stream)
if (stream->mode == OBJC_READONLY)
{
__objc_finish_read_root_object (stream); /* Just in case... */
hash_delete (stream->class_table);
hash_delete (stream->object_refs);
objc_hash_delete (stream->class_table);
objc_hash_delete (stream->object_refs);
}
hash_delete (stream->stream_table);
hash_delete (stream->object_table);
objc_hash_delete (stream->stream_table);
objc_hash_delete (stream->object_table);
if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM))
fclose ((FILE *)stream->physical);
@ -1648,7 +1660,8 @@ long
objc_get_stream_class_version (TypedStream *stream, Class class)
{
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
return class_get_version (class);
}

@ -6,20 +6,20 @@
Lock-free class table code designed and written from scratch by
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* 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
@ -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
structures is freeing data when is removed from the structures. */
#include "runtime.h" /* the kitchen sink */
#include "sarray.h"
#include "objc/runtime.h" /* the kitchen sink */
#include "objc/sarray.h"
#include <objc/objc.h>
#include <objc/objc-api.h>
#include <objc/thr.h>
#include "objc/objc.h"
#include "objc/objc-api.h"
#include "objc/thr.h"
/* We use a table which maps a class name to the corresponding class
* 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
/* 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.
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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
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. */
#include "tconfig.h"
#include "objc.h"
#include "encoding.h"
#include "objc/objc.h"
#include "objc/encoding.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#if OBJC_WITH_GC
#include <gc.h>
#include <limits.h>
/* gc_typed.h uses the following but doesn't declare them */
typedef GC_word word;
typedef GC_signed_word signed_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 */
#define BITS_PER_WORD (CHAR_BIT * sizeof (word))
#include <gc_typed.h>

@ -2,22 +2,22 @@
Copyright (C) 1997 Free Software Foundation, Inc.
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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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

@ -1,21 +1,21 @@
# GNU Objective C Runtime Makefile for compiling with djgpp
# 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
# 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
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# 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
# Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# GCC; see the file COPYING. If not, write to the Free Software
# Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# This Makefile is configured for GnuMAKE

@ -3,22 +3,22 @@
Free Software Foundation, Inc.
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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA. */
#define __USE_FIXED_PROTOTYPES__
#include <stdlib.h>
#include "runtime.h"
#include "objc/runtime.h"
/*
** Error handler function

@ -2,21 +2,21 @@
Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
/* This is the nil method, the function that is called when the receiver
of a method is nil */
#include "runtime.h"
#include "objc/runtime.h"
/* When the receiver of a method invocation is nil, the runtime
returns nil_method() as the method implementation. This function

@ -1,23 +1,23 @@
/* 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>
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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@ -28,7 +28,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __nxconstantstring_INCLUDE_GNU
#define __nxconstantstring_INCLUDE_GNU
#include "objc/Object.h"
#include "Object.h"
#ifdef __cplusplus
extern "C" {
#endif
@interface NXConstantString: Object
{
@ -41,4 +45,8 @@ Boston, MA 02111-1307, USA. */
@end
#ifdef __cplusplus
}
#endif
#endif

@ -1,22 +1,22 @@
/* Interface for the Object class for Objective-C.
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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled
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
#define __object_INCLUDE_GNU
#include <objc/objc.h>
#include <objc/typedstream.h>
#include "objc.h"
#include "typedstream.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* All classes are derived from Object. As such,
@ -121,4 +125,8 @@ Boston, MA 02111-1307, USA. */
@end
#ifdef __cplusplus
}
#endif
#endif

@ -1,22 +1,22 @@
/* 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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@ -27,7 +27,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __Protocol_INCLUDE_GNU
#define __Protocol_INCLUDE_GNU
#include "objc/Object.h"
#include "Object.h"
#ifdef __cplusplus
extern "C" {
#endif
@interface Protocol : Object
{
@ -52,7 +56,8 @@ Boston, MA 02111-1307, USA. */
@end
#ifdef __cplusplus
}
#endif
#endif /* not __Protocol_INCLUDE_GNU */

@ -1,24 +1,24 @@
/* 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
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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@ -29,8 +29,12 @@ Boston, MA 02111-1307, USA. */
#ifndef __encoding_INCLUDE_GNU
#define __encoding_INCLUDE_GNU
#include "objc-api.h"
#include <ctype.h>
#include "objc/objc-api.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define _C_CONST 'r'
#define _C_IN 'n'
@ -96,4 +100,8 @@ void objc_layout_structure_get_info (struct objc_struct_layout *layout,
unsigned int *align,
const char **type);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __encoding_INCLUDE_GNU */

@ -2,22 +2,22 @@
Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -28,6 +28,10 @@ Boston, MA 02111-1307, USA. */
#ifndef __GNU_OBJC_LIST_H
#define __GNU_OBJC_LIST_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct objc_list {
void *head;
struct objc_list *tail;
@ -64,9 +68,9 @@ list_length(struct objc_list* list)
larger than the list length, NULL is returned */
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)
list = list->tail;
@ -144,4 +148,9 @@ list_free(struct objc_list* list)
objc_free(list);
}
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* not __GNU_OBJC_LIST_H */

@ -1,22 +1,22 @@
/* 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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
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(*apply_t)(void); /* function pointer */
typedef union {
typedef union arglist {
char *arg_ptr;
char arg_regs[sizeof (char*)];
} *arglist_t; /* argument frame */

@ -1,23 +1,23 @@
/* 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.
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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@ -28,6 +28,8 @@ Boston, MA 02111-1307, USA. */
#ifndef __sarray_INCLUDE_GNU
#define __sarray_INCLUDE_GNU
#include "thr.h"
#define OBJC_SPARSE2 /* 2-level sparse array */
/* #define OBJC_SPARSE3 */ /* 3-level sparse array */
@ -40,16 +42,17 @@ extern const char* __objc_sparse3_id;
#endif
#include <stddef.h>
#include <assert.h>
#include "objc/thr.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
extern int nbuckets; /* for stats */
extern int nindices;
extern int narrays;
extern int idxsize;
#include <assert.h>
/* An unsigned integer of same size as a pointer */
#define SIZET_BITS (sizeof(size_t)*8)
@ -146,8 +149,8 @@ struct sarray* sarray_new(int, void* default_element);
void sarray_free(struct sarray*);
struct sarray* sarray_lazy_copy(struct sarray*);
void sarray_realloc(struct sarray*, int new_size);
void sarray_at_put(struct sarray*, sidx index, void* elem);
void sarray_at_put_safe(struct sarray*, sidx index, void* elem);
void sarray_at_put(struct sarray*, sidx indx, void* elem);
void sarray_at_put_safe(struct sarray*, sidx indx, void* elem);
struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
void sarray_remove_garbage(void);
@ -156,10 +159,10 @@ void sarray_remove_garbage(void);
#ifdef PRECOMPUTE_SELECTORS
/* Transform soffset values to ints and vica verca */
static inline unsigned int
soffset_decode(sidx index)
soffset_decode(sidx indx)
{
union sofftype x;
x.idx = index;
x.idx = indx;
#ifdef OBJC_SPARSE3
return x.off.eoffset
+ (x.off.boffset*BUCKET_SIZE)
@ -186,9 +189,9 @@ soffset_encode(size_t offset)
#else /* not PRECOMPUTE_SELECTORS */
static inline size_t
soffset_decode(sidx index)
soffset_decode(sidx indx)
{
return index;
return indx;
}
static inline sidx
@ -198,13 +201,13 @@ soffset_encode(size_t offset)
}
#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
union sofftype x;
x.idx = index;
x.idx = indx;
#ifdef OBJC_SPARSE3
return
array->
@ -217,21 +220,25 @@ static inline void* sarray_get(struct sarray* array, sidx index)
#else /* not PRECOMPUTE_SELECTORS */
#ifdef OBJC_SPARSE3
return array->
indices[index/INDEX_CAPACITY]->
buckets[(index/BUCKET_SIZE)%INDEX_SIZE]->
elems[index%BUCKET_SIZE];
indices[indx/INDEX_CAPACITY]->
buckets[(indx/BUCKET_SIZE)%INDEX_SIZE]->
elems[indx%BUCKET_SIZE];
#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 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)
return sarray_get(array, index);
if(soffset_decode(indx) < array->capacity)
return sarray_get(array, indx);
else
return (array->empty_bucket->elems[0]);
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __sarray_INCLUDE_GNU */

@ -1,32 +1,32 @@
/* 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)
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
the Free Software Foundation; either version 2, or (at your option)
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files
compiled with GCC to produce an executable, this does not cause
@ -38,7 +38,11 @@ Boston, MA 02111-1307, USA. */
#ifndef __thread_INCLUDE_GNU
#define __thread_INCLUDE_GNU
#include "objc/objc.h"
#include "objc.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*************************************************************************
* Universal static variables:
@ -142,4 +146,8 @@ objc_thread_t __objc_thread_id (void);
int __objc_thread_set_data (void *value);
void * __objc_thread_get_data (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* not __thread_INCLUDE_GNU */

@ -1,22 +1,22 @@
/* 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
Free Software 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
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, if you link this library with files compiled
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
#define __typedstream_INCLUDE_GNU
#include "objc/objc.h"
#include "objc/hash.h"
#include "objc.h"
#include "hash.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef int (*objc_typed_read_func)(void*, char*, int);
typedef int (*objc_typed_write_func)(void*, const char*, int);
typedef int (*objc_typed_flush_func)(void*);
@ -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_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);
void objc_flush_typed_stream (TypedStream* stream);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* not __typedstream_INCLUDE_GNU */

@ -2,21 +2,21 @@
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#include "tconfig.h" /* include defs of bzero for target */
#include "objc.h"
#include "runtime.h" /* the kitchen sink */
#include "objc/objc.h"
#include "objc/runtime.h" /* the kitchen sink */
#if OBJC_WITH_GC
# include <gc.h>

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#include <pthread.h>
#include <thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage;

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#include <pthread.h>
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage;

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -29,8 +29,8 @@ Boston, MA 02111-1307, USA. */
#include <sys/sysmp.h>
#include <sys/prctl.h>
#include <ulocks.h>
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */
static void * __objc_shared_arena_handle = NULL;

@ -1,21 +1,21 @@
/* GNU Objective C Runtime Thread Interface.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -24,12 +24,17 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#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 "coretypes.h"
#include "tm.h"
#include "defaults.h"
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
#include <gthr.h>
/* Backend initialization functions */

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
#define INCL_DOSSEMAPHORES
#define INCL_DOSPROCESS

@ -3,21 +3,21 @@
Contributed by Scott Christley <scottc@net-community.com>
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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 Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -26,8 +26,8 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#include <pcthread.h>
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Key structure for maintaining thread specific storage */
static pthread_key_t _objc_thread_storage;

@ -4,21 +4,21 @@
Renamed from thr-vxworks.c to thr-rtems.c by
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -26,8 +26,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Thread local storage for a single thread */
static void *thread_local_storage = NULL;

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Thread local storage for a single thread */
static void *thread_local_storage = NULL;

@ -3,21 +3,21 @@
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -25,8 +25,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
#include <thread.h>
#include <synch.h>

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#include <objc/thr.h>
#include "runtime.h"
#include "objc/thr.h"
#include "objc/runtime.h"
/* Thread local storage for a single thread */
static void *thread_local_storage = NULL;

18
thr.c

@ -2,21 +2,21 @@
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
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
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
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
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
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
GCC; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* 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
@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#include <stdlib.h>
#include "runtime.h"
#include "objc/runtime.h"
/* Global exit status. */
int __objc_thread_exit_status = 0;
@ -75,8 +75,8 @@ struct __objc_thread_start_state
id argument;
};
static volatile void
__objc_thread_detach_function (struct __objc_thread_start_state *istate)
static void __attribute__((noreturn))
__objc_thread_detach_function (struct __objc_thread_start_state *istate)
{
/* Valid state? */
if (istate) {

Loading…
Cancel
Save