*** empty log message ***
[gnulib.git] / m4 / dos.m4
1 # serial 3
2
3 # Define some macros required for proper operation of code in lib/*.c
4 # on MSDOS/Windows systems.
5
6 # From Jim Meyering.
7
8 AC_DEFUN(jm_AC_DOS,
9   [
10     # FIXME: this is incomplete.  Add a compile-test that does something
11     # like this:
12     #if defined _WIN32 || defined __WIN32__ || defined __MSDOS__
13
14     AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
15     [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
16 # define FILESYSTEM_PREFIX_LEN(Filename) \
17   ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
18 else
19 # define FILESYSTEM_PREFIX_LEN(Filename) 0
20 #endif])
21
22     ac_fs_accepts_drive_letter_prefix=0
23     AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
24       $ac_fs_accepts_drive_letter_prefix,
25       [Define on systems for which file names may have a so-called
26        `drive letter' prefix, define this to compute the length of that
27        prefix, including the colon.])
28
29     AH_VERBATIM(ISSLASH,
30     [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
31 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
32 #else
33 # define ISSLASH(C) ((C) == '/')
34 #endif])
35
36     ac_fs_backslash_is_file_name_separator=0
37     AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
38       $ac_fs_backslash_is_file_name_separator,
39       [Define if the backslash character may also serve as a file name
40        component separator.])
41   ])