nasmlib: include macro for Mach system and fix on filename extraction

Add __MACH__ as a Unix-like system (e.g. MacOS X defines __MACH__ but
no variant of __unix__.)

Fix a reversed test in first_filename_char().

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
Chang S. Bae 2017-04-24 21:03:33 -07:00 committed by H. Peter Anvin
parent c6bbfaa70d
commit 64dd380f1e

View File

@ -39,7 +39,7 @@
#include "nasmlib.h"
#include "error.h"
#if defined(unix) || defined(__unix) || defined(__unix__)
#if defined(unix) || defined(__unix) || defined(__unix__) || defined(__MACH__)
# define separators "/"
# define cleandirend "/"
# define catsep '/'
@ -93,7 +93,7 @@ static const char *first_filename_char(const char *path)
const char *p = path + strlen(path);
while (p > path) {
if (!ismatch(separators, p[-1]))
if (ismatch(separators, p[-1]))
return p;
p--;
}