1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[meson] check for open_memstream

This commit is contained in:
Witold Filipczyk 2024-11-19 18:03:22 +01:00
parent 2ce1d23ee4
commit af8ecb8632
3 changed files with 9 additions and 0 deletions

View File

@ -548,6 +548,9 @@
/* Define if you have off_t */
#mesondefine HAVE_OFF_T
/* Define if you have the `open_memstream' function. */
#mesondefine HAVE_OPEN_MEMSTREAM
/* Define to 1 if you have the `poll' function. */
#mesondefine HAVE_POLL

View File

@ -1116,6 +1116,10 @@ if compiler.has_function('strtoul', prefix: '#include <stdlib.h>')
conf_data.set('HAVE_STRTOUL', 1)
endif
if compiler.has_function('open_memstream', prefix: '#include <stdio.h>')
conf_data.set('HAVE_OPEN_MEMSTREAM', 1)
endif
if compiler.compiles('int a; typeof(a) b;', name: 'typeof')
conf_data.set('HAVE_TYPEOF', 1)
endif

View File

@ -80,6 +80,7 @@ void *map_interp;
static void
quickjs_get_version(char *quickjs_version)
{
#ifdef HAVE_OPEN_MEMSTREAM
char *ptr = NULL;
size_t size = 0;
FILE *f = open_memstream(&ptr, &size);
@ -108,6 +109,7 @@ quickjs_get_version(char *quickjs_version)
}
free(ptr);
}
#endif
}
static const char *