[OpenMP] Make omp.h
work when compiled with -ffreestanding
(#125618)
Summary: Freestanding builds have `stddef.h` and `stdint.h` but not `stdlib.h`. We don't actually use any `stdlib.h` definitions in the OpenMP headers, and some definitions from this header are usable without the OpenMP runtime (allocators) so we should be able to do this. This ignores the include if possible, removing the implicit include would possibly break some applications so it stays here.
This commit is contained in:
parent
d7aa6e379e
commit
daefb1b012
@ -15,8 +15,14 @@
|
||||
#ifndef __OMP_H
|
||||
# define __OMP_H
|
||||
|
||||
# ifndef __has_include
|
||||
# define __has_include(x) 0
|
||||
# endif
|
||||
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
# if (__has_include(<stdlib.h>))
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
# include <stdint.h>
|
||||
|
||||
# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
|
||||
|
Loading…
x
Reference in New Issue
Block a user