From 444839b842798497cfa326204285a4f2ca2362af Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 24 Jan 2014 14:35:39 -0800 Subject: libGLES_android: fix 64-bit compile errors Fix size of vertex_t on 64-bit architectures Fix __get_tls casts, the TLS area is a void** Cast through uintptr_t to store integers in a pointer Use %zu to print size_t Change-Id: I91079ec76025237e6d2081784c5348518b0ce122 --- opengl/libagl/context.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'opengl/libagl/context.h') diff --git a/opengl/libagl/context.h b/opengl/libagl/context.h index 7065a30324..c599a55aaf 100644 --- a/opengl/libagl/context.h +++ b/opengl/libagl/context.h @@ -147,7 +147,11 @@ struct vertex_t { vec4_t color; vec4_t texture[GGL_TEXTURE_UNIT_COUNT]; +#ifdef __LP64__ + uint32_t reserved1[2]; +#else uint32_t reserved1[4]; +#endif inline void clear() { flags = index = locked = mru = 0; @@ -578,10 +582,10 @@ private: #ifdef HAVE_ANDROID_OS // We have a dedicated TLS slot in bionic inline void setGlThreadSpecific(ogles_context_t *value) { - ((uint32_t *)__get_tls())[TLS_SLOT_OPENGL] = (uint32_t)value; + __get_tls()[TLS_SLOT_OPENGL] = value; } inline ogles_context_t* getGlThreadSpecific() { - return (ogles_context_t *)(((unsigned *)__get_tls())[TLS_SLOT_OPENGL]); + return static_cast(__get_tls()[TLS_SLOT_OPENGL]); } #else extern pthread_key_t gGLKey; -- cgit v1.2.3-59-g8ed1b