Expose macro globally

This commit is contained in:
Aaron Culliney 2015-10-04 14:39:53 -07:00
parent f4fa5670b4
commit 51f5bc64ba
2 changed files with 14 additions and 13 deletions

View File

@ -22,19 +22,6 @@ enum {
#include <jni.h>
// cribbed from AOSP and modified with usleep() and to also ignore EAGAIN (should this be a different errno than EINTR)
#define TEMP_FAILURE_RETRY_FOPEN(exp) ({ \
typeof (exp) _rc; \
do { \
_rc = (exp); \
if (_rc == NULL && (errno == EINTR || errno == EAGAIN) ) { \
usleep(10); \
} else { \
break; \
} \
} while (1); \
_rc; })
static volatile int __attribute__((noinline)) _crash_null_deref(void) {
static volatile uintptr_t *ptr = NULL;
while ((ptr+1)) {

View File

@ -133,6 +133,20 @@ static inline GLenum safeGLGetError(void) {
__sync_add_and_fetch((x), 1);
// cribbed from AOSP and modified with usleep() and to also ignore EAGAIN (should this be a different errno than EINTR)
#define TEMP_FAILURE_RETRY_FOPEN(exp) ({ \
typeof (exp) _rc; \
do { \
_rc = (exp); \
if (_rc == NULL && (errno == EINTR || errno == EAGAIN) ) { \
usleep(10); \
} else { \
break; \
} \
} while (1); \
_rc; })
extern bool do_logging;
#ifdef ANDROID