Skip to content

PATH_MAX is not defined on linux when building with -std=c99 #61

Closed
@schodet

Description

Actually documentation says that it can be undefined if no real limit is applicable.

Would this be OK?:

diff --git a/tinydir.h b/tinydir.h
index 324f9f6..7863564 100644
--- a/tinydir.h
+++ b/tinydir.h
@@ -89,7 +89,9 @@ extern "C" {
 # define _TINYDIR_PATH_MAX MAX_PATH
 #elif defined  __linux__
 # include <limits.h>
-# define _TINYDIR_PATH_MAX PATH_MAX
+# ifdef PATH_MAX
+#  define _TINYDIR_PATH_MAX PATH_MAX
+# endif
 #elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 # include <sys/param.h>
 # if defined(BSD)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions