20 Nov
2009
20 Nov
'09
11:27 a.m.
Richard W.M. Jones wrote:
Subject: [PATCH 3/6] daemon/Win32: NAME_MAX does not exist on Windows, use FILENAME_MAX instead.
--- daemon/realpath.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/daemon/realpath.c b/daemon/realpath.c index 17e74ea..02a82d6 100644 --- a/daemon/realpath.c +++ b/daemon/realpath.c @@ -32,6 +32,11 @@ #include "daemon.h" #include "actions.h"
+/* On Windows, NAME_MAX is not defined. */ +#ifndef NAME_MAX +#define NAME_MAX FILENAME_MAX +#endif
Looks fine.
From back when I had to deal with cpp conditionals nested to a depth of 8 or even 10, I've come to appreciate using indentation to reflect cpp condition nesting, even on a small scale:
#ifndef NAME_MAX # define NAME_MAX FILENAME_MAX #endif