meson: define ETIME to ETIMEDOUT if not present

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
Greg V 2018-01-19 00:48:30 +03:00 committed by Eric Engestrom
parent 28061e0ab0
commit c0dc5c1859
3 changed files with 5 additions and 6 deletions

View file

@ -778,6 +778,11 @@ if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6')
error('When using GCC, version 4.4.6 or later is required.')
endif
# Support systems without ETIME (e.g. FreeBSD)
if cc.get_define('ETIME', prefix : '#include <errno.h>') == ''
pre_args += '-DETIME=ETIMEDOUT'
endif
# Define DEBUG for debug builds only (debugoptimized is not included on this one)
if get_option('buildtype') == 'debug'
pre_args += '-DDEBUG'

View file

@ -51,9 +51,6 @@
#include <time.h>
#include "errno.h"
#ifndef ETIME
#define ETIME ETIMEDOUT
#endif
#include "common/gen_clflush.h"
#include "dev/gen_debug.h"
#include "common/gen_gem.h"

View file

@ -49,9 +49,6 @@
#include <stdbool.h>
#include "errno.h"
#ifndef ETIME
#define ETIME ETIMEDOUT
#endif
#include "common/gen_clflush.h"
#include "dev/gen_debug.h"
#include "common/gen_gem.h"