diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-24 21:02:36 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-24 21:02:36 +0000 |
commit | d461d0f677cd6c460e73de7e5112e2002f8fc42f (patch) | |
tree | d4054b9ccee889a0365a1284dd577cf7e13c7d0c /libjava/gcj/array.h | |
parent | dc49b4973ad9fc04b71abeb6b5996ed00d52f0d0 (diff) | |
download | ppe42-gcc-d461d0f677cd6c460e73de7e5112e2002f8fc42f.tar.gz ppe42-gcc-d461d0f677cd6c460e73de7e5112e2002f8fc42f.zip |
* prims.cc (_Jv_NewObjectArray): Use palcement new to create
array.
(_Jv_NewPrimArray): Likewise.
Include <new>.
* gcj/array.h (__JArray): `length' field now const. Added
constructor.
(class JArray): Added constructor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37718 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gcj/array.h')
-rw-r--r-- | libjava/gcj/array.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libjava/gcj/array.h b/libjava/gcj/array.h index 8b0a416d758..7c659241681 100644 --- a/libjava/gcj/array.h +++ b/libjava/gcj/array.h @@ -1,6 +1,6 @@ // array.h - Header file for CNI arrays. -*- c++ -*- -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. @@ -17,11 +17,21 @@ extern "Java" { class __JArray : public java::lang::Object { +protected: + // FIXME: this is a hack to work around a bug in the g++ Java + // support. If we add a constructor with a jsize argument to + // JArray<T>, then g++ complains. + __JArray () : length (0) + { + } public: - // FIXME: we'd like this to be `const' but that causes problems with - // the C++ compiler. - jsize length; + const jsize length; friend jsize JvGetArrayLength (__JArray*); + + // This probably shouldn't be public. + __JArray (jsize l) : length (l) + { + } }; template<class T> |