chiark / gitweb /
Add better ARM/Android support, support a wider variety of configure options.
[stressapptest] / src / sattypes.h
index 96bf13b91f81a839972b4364f99f3392991cbef5..c9341d0b00642ccea3a2d125bce22e864f8e6c8f 100644 (file)
 #include <string>
 
 #ifdef HAVE_CONFIG_H  // Built using autoconf
+#ifdef __ANDROID__
+#include "stressapptest_config_android.h"
+#else
 #include "stressapptest_config.h"
-using namespace std;
 using namespace __gnu_cxx;
+#endif
+using namespace std;
 
 typedef signed long long   int64;
 typedef signed int         int32;
@@ -172,7 +176,14 @@ inline bool sat_sleep(time_t seconds) {
 //   error_num: an errno error code
 inline string ErrorString(int error_num) {
   char buf[256];
+#ifdef STRERROR_R_CHAR_P
   return string(strerror_r(error_num, buf, sizeof buf));
+#else
+  if (strerror_r(error_num, buf, sizeof buf))
+    return "unknown failure";
+  else
+    return string(buf);
+#endif
 }
 
 // Define handy constants here