From faf970786407963962aea9eb7be04c8706c2dffc Mon Sep 17 00:00:00 2001 From: szaka Date: Wed, 21 Jan 2009 23:51:02 +0000 Subject: [PATCH] move conditional PATH_MAX define to compat.h --- include/ntfs-3g/compat.h | 8 ++++++++ libntfs-3g/volume.c | 7 ++----- src/ntfs-3g.c | 5 +---- src/ntfs-3g.probe.c | 7 ++----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/include/ntfs-3g/compat.h b/include/ntfs-3g/compat.h index 148f8b75..d6620593 100644 --- a/include/ntfs-3g/compat.h +++ b/include/ntfs-3g/compat.h @@ -3,6 +3,7 @@ * * Copyright (c) 2002 Richard Russon * Copyright (c) 2002-2004 Anton Altaparmakov + * Copyright (c) 2008-2009 Szabolcs Szakacsits * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -26,6 +27,13 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif + +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #ifndef HAVE_FFS extern int ffs(int i); diff --git a/libntfs-3g/volume.c b/libntfs-3g/volume.c index e4ba6b56..cb152b4d 100644 --- a/libntfs-3g/volume.c +++ b/libntfs-3g/volume.c @@ -2,7 +2,7 @@ * volume.c - NTFS volume handling code. Originated from the Linux-NTFS project. * * Copyright (c) 2000-2006 Anton Altaparmakov - * Copyright (c) 2002-2008 Szabolcs Szakacsits + * Copyright (c) 2002-2009 Szabolcs Szakacsits * Copyright (c) 2004-2005 Richard Russon * * This program/include file is free software; you can redistribute it and/or @@ -53,6 +53,7 @@ #include #endif +#include "compat.h" #include "volume.h" #include "attrib.h" #include "mft.h" @@ -66,10 +67,6 @@ #include "logging.h" #include "misc.h" -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - const char *ntfs_home = "Ntfs-3g news, support and information: http://ntfs-3g.org\n"; diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index fd649f32..a7b2e579 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -4,6 +4,7 @@ * Copyright (c) 2005-2007 Yura Pakhuchiy * Copyright (c) 2005 Yuval Fledel * Copyright (c) 2006-2009 Szabolcs Szakacsits + * Copyright (c) 2007-2009 Jean-Pierre Andre * Copyright (c) 2009 Erik Larsson * * This file is originated from the Linux-NTFS project. @@ -93,10 +94,6 @@ #include "ntfstime.h" #include "misc.h" -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - typedef enum { FSTYPE_NONE, FSTYPE_UNKNOWN, diff --git a/src/ntfs-3g.probe.c b/src/ntfs-3g.probe.c index be265dd7..592abd76 100644 --- a/src/ntfs-3g.probe.c +++ b/src/ntfs-3g.probe.c @@ -1,7 +1,7 @@ /** * ntfs-3g.probe - Probe NTFS volume mountability * - * Copyright (c) 2007 Szabolcs Szakacsits + * Copyright (c) 2007-2009 Szabolcs Szakacsits * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,13 +32,10 @@ #endif #include +#include "compat.h" #include "volume.h" #include "misc.h" -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - typedef enum { PROBE_UNSET, PROBE_READONLY,