This commit is contained in:
Henrik Rydgard 2012-08-06 22:05:24 +02:00
parent 04cdca530b
commit b8cafe1561
5 changed files with 10 additions and 62 deletions

View File

@ -6,7 +6,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libnative
LOCAL_SRC_FILES :=\
android/app-android.cpp \
android/native_audio.cpp \
audio/wav_read.cpp \
audio/mixer.cpp.arm \
@ -51,7 +50,7 @@ LOCAL_SRC_FILES :=\
util/random/perlin.cpp
LOCAL_CFLAGS := -O2 -DANDROID_NDK -DUSE_GLES2
LOCAL_CFLAGS := -O2
LOCAL_CPPFLAGS := -fno-exceptions -fno-rtti -std=gnu++0x
LOCAL_LDLIBS := -lz
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ext/libzip

View File

@ -90,8 +90,6 @@ public class NativeActivity extends Activity {
public static String installID;
private EditText editText;
String getApplicationLibraryDir(ApplicationInfo application) {
String libdir = null;
try {

View File

@ -11,31 +11,13 @@
#pragma once
/* For ANSI-challenged compilers, you may want to #define
* NO_MEMBER_TEMPLATES, explicit or mutable */
#define NO_MEMBER_TEMPLATES
template <class X> class linked_ptr
{
public:
explicit linked_ptr(X* p = 0) throw() : itsPtr(p) {itsPrev = itsNext = this;}
~linked_ptr() {release();}
linked_ptr(const linked_ptr& r) throw() {acquire(r);}
#ifndef NO_MEMBER_TEMPLATES
# define TEMPLATE_FUNCTION template <class Y>
TEMPLATE_FUNCTION friend class linked_ptr<Y>;
#else
# define TEMPLATE_FUNCTION
typedef X Y;
#endif
typedef X element_type;
explicit linked_ptr(X* p = 0) throw()
: itsPtr(p) {itsPrev = itsNext = this;}
~linked_ptr()
{release();}
linked_ptr(const linked_ptr& r) throw()
{acquire(r);}
linked_ptr& operator=(const linked_ptr& r)
{
if (this != &r) {
@ -45,24 +27,10 @@ public:
return *this;
}
#ifndef NO_MEMBER_TEMPLATES
template <class Y> friend class linked_ptr<Y>;
template <class Y> linked_ptr(const linked_ptr<Y>& r) throw()
{acquire(r);}
template <class Y> linked_ptr& operator=(const linked_ptr<Y>& r)
{
if (this != &r) {
release();
acquire(r);
}
return *this;
}
#endif // NO_MEMBER_TEMPLATES
X& operator*() const throw() {return *itsPtr;}
X* operator->() const throw() {return itsPtr;}
X* get() const throw() {return itsPtr;}
bool unique() const throw() {return itsPrev ? itsPrev==this : true;}
X& operator*() const throw() {return *itsPtr;}
X* operator->() const throw() {return itsPtr;}
X* get() const throw() {return itsPtr;}
bool unique() const throw() {return itsPrev ? itsPrev==this : true;}
private:
X* itsPtr;
@ -75,28 +43,9 @@ private:
itsNext = r.itsNext;
itsNext->itsPrev = this;
itsPrev = &r;
#ifndef mutable
r.itsNext = this;
#else // for ANSI-challenged compilers
(const_cast<linked_ptr<X>*>(&r))->itsNext = this;
#endif
}
#ifndef NO_MEMBER_TEMPLATES
template <class Y> void acquire(const linked_ptr<Y>& r) throw()
{ // insert this to the list
itsPtr = r.itsPtr;
itsNext = r.itsNext;
itsNext->itsPrev = this;
itsPrev = &r;
#ifndef mutable
r.itsNext = this;
#else // for ANSI-challenged compilers
(const_cast<linked_ptr<X>*>(&r))->itsNext = this;
#endif
}
#endif // NO_MEMBER_TEMPLATES
void release()
{ // erase this from the list, delete if unique
if (unique()) delete itsPtr;

View File

@ -90,6 +90,7 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="Android.mk" />
<None Include="base\CMakeLists.txt" />
<None Include="file\CMakeLists.txt" />
<None Include="README.md" />

View File

@ -8,6 +8,7 @@
<None Include="base\CMakeLists.txt">
<Filter>base</Filter>
</None>
<None Include="Android.mk" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="gfx\gl_debug_log.h">