--- include/CL/cl.hpp.in	2014-03-17 17:47:57.147223265 +0200
+++ include/CL/cl.hpp	2014-03-17 17:55:52.620234165 +0200
@@ -173,6 +173,9 @@
 #include <OpenGL/OpenGL.h>
 #include <OpenCL/opencl.h>
 #include <libkern/OSAtomic.h>
+#elif defined(__ANDROID__)
+#include <GLES/gl.h>
+#include <CL/opencl.h>
 #else
 #include <GL/gl.h>
 #include <CL/opencl.h>
@@ -211,11 +214,9 @@
 #include <string>
 #endif

-#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
+#if defined(linux) || defined(__APPLE__) || defined(__MACOSX) || defined(__ANDROID__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
 #include <alloca.h>
 
-#include <emmintrin.h>
-#include <xmmintrin.h>
 #endif // linux
 
 #include <cstring>
@@ -1038,8 +1036,14 @@
 #endif // !_WIN32
     }
 
-    inline void fence() { _mm_mfence(); }
-}; // namespace detail
+    inline void fence() { 
+#ifdef _MSC_VER
+        _mm_mfence();
+#else
+        __sync_synchronize();
+#endif
+    }
+} // namespace details
 
     
 /*! \brief class used to interface between C++ and
