Alfred Persson Forsberg 0fb3066873 [libc] Add limits.h
This header contains implementation specific constants.

The compiler already provides its own limits.h with numerical limits
conforming to freestanding ISO C. But it is missing extensions like
POSIX, and does for example not include <linux/limits.h> which is
expected on a Linux system, therefore, an LLVM libc implementation of
limits.h is needed for hosted (__STDC_HOSTED__) environments.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D156961
2023-08-14 01:35:44 +01:00

13 lines
240 B
C

#ifndef __LLVM_LIBC_MACROS_LIMITS_MACROS_H
#define __LLVM_LIBC_MACROS_LIMITS_MACROS_H
#ifdef __linux__
#include <linux/limits.h>
#endif
#ifndef SSIZE_MAX
#define SSIZE_MAX __LONG_MAX__
#endif
#endif // __LLVM_LIBC_MACROS_LIMITS_MACROS_H