Ignore:
Timestamp:
2019-05-27T12:38:26Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d14c25
Parents:
4d51c60
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-13 16:06:49)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-05-27 12:38:26)
Message:

Make some libc and libposix headers usable in C++

These headers either get included from standard C++ headers,
or are standard themselves, which means any unnamespaced nonstandard
identifiers are a problem. This commit attempts to fix those
issues, and removes hacks previously used in libcpp to work around it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/sys/stat.h

    r4d51c60 rbc56f30  
    3939#include <sys/types.h>
    4040#include <time.h>
     41#include <_bits/decls.h>
    4142
    4243/* values are the same as on Linux */
    4344
    44 #undef S_IFMT
    45 #undef S_IFSOCK
    46 #undef S_IFLNK
    47 #undef S_IFREG
    48 #undef S_IFBLK
    49 #undef S_IFDIR
    50 #undef S_IFCHR
    51 #undef S_IFIFO
    5245#define S_IFMT     0170000   /* all file types */
    5346#define S_IFSOCK   0140000   /* socket */
     
    5952#define S_IFIFO    0010000   /* FIFO */
    6053
    61 #undef S_ISUID
    62 #undef S_ISGID
    63 #undef S_ISVTX
    6454#define S_ISUID    0004000   /* SUID */
    6555#define S_ISGID    0002000   /* SGID */
    6656#define S_ISVTX    0001000   /* sticky */
    6757
    68 #undef S_IRWXU
    69 #undef S_IRUSR
    70 #undef S_IWUSR
    71 #undef S_IXUSR
    7258#define S_IRWXU    00700     /* owner permissions */
    7359#define S_IRUSR    00400
     
    7561#define S_IXUSR    00100
    7662
    77 #undef S_IRWXG
    78 #undef S_IRGRP
    79 #undef S_IWGRP
    80 #undef S_IXGRP
    8163#define S_IRWXG    00070     /* group permissions */
    8264#define S_IRGRP    00040
     
    8466#define S_IXGRP    00010
    8567
    86 #undef S_IRWXO
    87 #undef S_IROTH
    88 #undef S_IWOTH
    89 #undef S_IXOTH
    9068#define S_IRWXO    00007     /* other permissions */
    9169#define S_IROTH    00004
     
    9371#define S_IXOTH    00001
    9472
    95 #undef S_ISREG
    96 #undef S_ISDIR
    97 #undef S_ISCHR
    98 #undef S_ISBLK
    99 #undef S_ISFIFO
    100 #undef S_ISLNK
    101 #undef S_ISSOCK
    10273#define S_ISREG(m) ((m & S_IFREG) != 0)
    10374#define S_ISDIR(m) ((m & S_IFDIR) != 0)
     
    10778#define S_ISLNK(m) ((m & S_IFLNK) != 0) /* symbolic link? (Not in POSIX.1-1996.) */
    10879#define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */
     80
     81__C_DECLS_BEGIN;
    10982
    11083struct stat {
     
    131104extern int mkdir(const char *path, mode_t mode);
    132105
     106__C_DECLS_END;
     107
    133108#endif /* POSIX_SYS_STAT_H */
    134109
Note: See TracChangeset for help on using the changeset viewer.