]> Kevux Git Server - fll/commitdiff
Update: Remove usage of <linux/limits.h>.
authorKevin Day <thekevinday@gmail.com>
Tue, 11 May 2021 23:07:47 +0000 (18:07 -0500)
committerKevin Day <thekevinday@gmail.com>
Tue, 11 May 2021 23:07:47 +0000 (18:07 -0500)
The <linux/limits.h> header file is only used to get PATH_MAX.
Instead of including the entire header, just provided a fallback PATH_MAX.

level_0/f_path/c/path.h

index 129c82734bf43f53b4b20e2437fcd758c23758b8..6dad33ff2fa2c23679a6e4d956b10b8e77688494 100644 (file)
 
 // libc includes
 #include <limits.h>
-#include <linux/limits.h> // defines PATH_MAX
 #include <stdlib.h>
 #include <string.h>
 
+// If limits.h does not provide PATH_MAX, define it instead of relying on <linux/limits.h>.
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif /* PATH_MAX */
+
 // fll-0 includes
 #include <fll/level_0/type.h>
 #include <fll/level_0/status.h>