Sfoglia il codice sorgente

mesa/imports: let the build system detect strtok_r()

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2013
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
merge-requests/2612/head
Eric Engestrom 6 anni fa
parent
commit
73cc2fec10
3 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 1
    1
      meson.build
  2. 3
    0
      scons/gallium.py
  3. 1
    1
      src/mesa/main/imports.h

+ 1
- 1
meson.build Vedi File

@@ -1149,7 +1149,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'
endif
endforeach

foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r', 'flock']
foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r', 'flock', 'strtok_r']
if cc.has_function(f)
pre_args += '-DHAVE_@0@'.format(f.to_upper())
endif

+ 3
- 0
scons/gallium.py Vedi File

@@ -381,6 +381,9 @@ def generate(env):
if check_header(env, 'sys/shm.h'):
cppdefines += ['HAVE_SYS_SHM_H']

if check_functions(env, ['strtok_r']):
cppdefines += ['HAVE_STRTOK_R']

#FIXME: we should really be checking for the major()/minor()
# functions/macros in these headers, but check_functions()'s
# SConf.CheckFunc() doesn't seem to support macros.

+ 1
- 1
src/mesa/main/imports.h Vedi File

@@ -309,7 +309,7 @@ extern int
_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);


#if defined(_WIN32) && !defined(strtok_r)
#if defined(_WIN32) && !defined(HAVE_STRTOK_R)
#define strtok_r strtok_s
#endif


Loading…
Annulla
Salva