[Mesa-dev] [PATCH] r600g/sb: Fix Android build

Tom Stellard tom at stellard.net
Thu Jun 27 14:31:05 PDT 2013


From: Chih-Wei Huang <cwhuang at android-x86.org>

Add the sb CXX files to the Android Makefile and also stop using some
c++11 features.
---
 src/gallium/drivers/r600/Android.mk         | 5 +++--
 src/gallium/drivers/r600/sb/sb_bc.h         | 4 ++--
 src/gallium/drivers/r600/sb/sb_ra_init.cpp  | 2 +-
 src/gallium/drivers/r600/sb/sb_valtable.cpp | 4 ++--
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r600/Android.mk b/src/gallium/drivers/r600/Android.mk
index e5188bb..4d2f69f 100644
--- a/src/gallium/drivers/r600/Android.mk
+++ b/src/gallium/drivers/r600/Android.mk
@@ -28,11 +28,12 @@ include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES := $(C_SOURCES)
+LOCAL_SRC_FILES := $(C_SOURCES) $(CXX_SOURCES)
 
-LOCAL_C_INCLUDES :=
+LOCAL_C_INCLUDES := $(DRM_TOP)
 
 LOCAL_MODULE := libmesa_pipe_r600
 
+include external/stlport/libstlport.mk
 include $(GALLIUM_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h
index 25255a7..73c250d 100644
--- a/src/gallium/drivers/r600/sb/sb_bc.h
+++ b/src/gallium/drivers/r600/sb/sb_bc.h
@@ -846,7 +846,7 @@ public:
 	unsigned ndw() { return bc.size(); }
 
 	void write_data(uint32_t* dst) {
-		memcpy(dst, bc.data(), 4 * bc.size());
+		std::copy(bc.begin(), bc.end(), dst);
 	}
 
 	void align(unsigned a) {
@@ -870,7 +870,7 @@ public:
 	}
 
 	unsigned get_pos() { return pos; }
-	uint32_t *data() { return bc.data(); }
+	uint32_t *data() { return bc.begin(); }
 
 	bytecode & operator <<(uint32_t v) {
 		if (pos == ndw()) {
diff --git a/src/gallium/drivers/r600/sb/sb_ra_init.cpp b/src/gallium/drivers/r600/sb/sb_ra_init.cpp
index bfe5ab9..24b24a0 100644
--- a/src/gallium/drivers/r600/sb/sb_ra_init.cpp
+++ b/src/gallium/drivers/r600/sb/sb_ra_init.cpp
@@ -680,7 +680,7 @@ void ra_split::split_vec(vvec &vv, vvec &v1, vvec &v2, bool allow_swz) {
 
 			value *t;
 			vvec::iterator F =
-					allow_swz ? find(v2.begin(), v2.end(), o) : v2.end();
+					allow_swz ? std::find(v2.begin(), v2.end(), o) : v2.end();
 
 			if (F != v2.end()) {
 				t = *(v1.begin() + (F - v2.begin()));
diff --git a/src/gallium/drivers/r600/sb/sb_valtable.cpp b/src/gallium/drivers/r600/sb/sb_valtable.cpp
index 5e6aca0..00aee66 100644
--- a/src/gallium/drivers/r600/sb/sb_valtable.cpp
+++ b/src/gallium/drivers/r600/sb/sb_valtable.cpp
@@ -207,7 +207,7 @@ void value_table::get_values(vvec& v) {
 
 	for(vt_table::iterator I = hashtable.begin(), E = hashtable.end();
 			I != E; ++I) {
-		T = copy(I->begin(), I->end(), T);
+		T = std::copy(I->begin(), I->end(), T);
 	}
 }
 
@@ -368,7 +368,7 @@ inline bool sb_bitset::set_chk(unsigned id, bool bit) {
 }
 
 void sb_bitset::clear() {
-	memset(data.data(), 0, sizeof(basetype) * data.size());
+	std::fill(data.begin(), data.end(), 0);
 }
 
 void sb_bitset::resize(unsigned size) {
-- 
1.8.1.4



More information about the mesa-dev mailing list