1 #ifdef PIXMAN_FB_ACCESSORS 2 3 #define READ(img, ptr) \ 4 (((bits_image_t *)(img))->read_func ((ptr), sizeof(*(ptr)))) 5 #define WRITE(img, ptr,val) \ 6 (((bits_image_t *)(img))->write_func ((ptr), (val), sizeof (*(ptr)))) 7 8 #define MEMSET_WRAPPED(img, dst, val, size) \ 9 do { \ 10 size_t _i; \ 11 uint8_t *_dst = (uint8_t*)(dst); \ 12 for(_i = 0; _i < (size_t) size; _i++) { \ 13 WRITE((img), _dst +_i, (val)); \ 14 } \ 15 } while (0) 16 17 #else 18 19 #define READ(img, ptr) (*(ptr)) 20 #define WRITE(img, ptr, val) (*(ptr) = (val)) 21 #define MEMSET_WRAPPED(img, dst, val, size) \ 22 memset(dst, val, size) 23 24 #endif 25 26