Commit Graph

5 Commits

Author SHA1 Message Date
H. Peter Anvin
c26a7d4cbe nasmlib/path.c: a few more detection macros
Add a few more operating system detection macros, including BeOS.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-25 13:18:36 -07:00
Chang S. Bae
64dd380f1e 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>
2017-04-25 12:53:52 -07:00
H. Peter Anvin
d00d8c6ac3 nasmlib: fix MacOS classic catsep definition
Correct the definition for MacOS classic "catsep" in nasm_catfile().
Also put in a stern comment that this function doesn't handle
filenames with path components.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:11:12 -07:00
H. Peter Anvin
11a07a7319 nasmlib: add function to splice pathnames
Add a function to splice a pathname consisting of a directory and a
filename.  It is worth noting that this function is limited to that
particular use case: in particular, it does NOT currently support
concatenating a filename which itself contains directory components to
a non-null directory.

Combining directory names is extremely system-dependent and probably
needs more than just parameterized code in many cases, for example,
on VMS combining "foo:[bar]" with "[baz]quux" should produce
"foo:[bar.baz]quux" whereas combining "foo:[bar]" and baz:quux" is an
outright error.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:01:00 -07:00
H. Peter Anvin
0979957e19 nasmlib: add path-splitting functions
Some debugging formats may need to be able to split paths into
directory name and filename, at least.  This is kind of iffy, at least
across platforms, but that isn't really expected to be an issue in
practice... we hope.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 22:39:53 -07:00