Ticket #2516: Fix build failure on DragonFly BSD

DragonFly BSD doesn't provide MAXNAMLEN macro to define size of d_name
member of dirent structure. NAME_MAX is used if MAXNAMLEN is not
provided by OS.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2011-04-06 15:31:52 +04:00
parent 12eb8b62c4
commit 32bffa8890

View File

@ -67,12 +67,13 @@
#define NLENGTH(dirent) (strlen ((dirent)->d_name))
#define DIRENT_LENGTH_COMPUTED 1
/* DragonFlyBSD doesn't provide MAXNAMLEN macro */
#ifndef MAXNAMLEN
#define MC_MAXFILENAMELEN 256
#else
#define MC_MAXFILENAMELEN MAXNAMLEN
#define MAXNAMLEN NAME_MAX
#endif
#define MC_MAXFILENAMELEN MAXNAMLEN
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/