gcc 15 and C23 force some union trickery on buffer.h :-(
add a few buffer_init*_forread variants to pretend we have type safety make sure buffer_init_staticcontents handles flushing attempts
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#include <libowfat/buffer.h>
|
||||
#include <libowfat/mmap.h>
|
||||
|
||||
static ssize_t op() {
|
||||
static ssize_t op(int fd,void* buf,size_t l) {
|
||||
(void)fd;
|
||||
(void)buf;
|
||||
(void)l;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9,7 +12,7 @@ int buffer_mmapread(buffer* b,const char* filename) {
|
||||
if (!(b->x=(char*)mmap_read(filename,&b->n))) return -1;
|
||||
b->p=0; b->a=b->n;
|
||||
b->fd=-1;
|
||||
b->op=op;
|
||||
b->op.rop=op;
|
||||
b->deinit=buffer_munmap;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user