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/unistd.h

    r4d51c60 rbc56f30  
    4646/* Process Termination */
    4747#define _exit exit
     48
     49/* Standard Streams */
     50#define STDIN_FILENO (fileno(stdin))
     51#define STDOUT_FILENO (fileno(stdout))
     52#define STDERR_FILENO (fileno(stderr))
     53
     54#define F_OK 0 /* Test for existence. */
     55#define X_OK 1 /* Test for execute permission. */
     56#define W_OK 2 /* Test for write permission. */
     57#define R_OK 4 /* Test for read permission. */
     58
     59__C_DECLS_BEGIN;
    4860
    4961extern char *optarg;
     
    106118#endif
    107119
    108 /* Standard Streams */
    109 #undef STDIN_FILENO
    110 #define STDIN_FILENO (fileno(stdin))
    111 #undef STDOUT_FILENO
    112 #define STDOUT_FILENO (fileno(stdout))
    113 #undef STDERR_FILENO
    114 #define STDERR_FILENO (fileno(stderr))
    115 
    116120/* File Accessibility */
    117 #undef F_OK
    118 #undef X_OK
    119 #undef W_OK
    120 #undef R_OK
    121 #define F_OK 0 /* Test for existence. */
    122 #define X_OK 1 /* Test for execute permission. */
    123 #define W_OK 2 /* Test for write permission. */
    124 #define R_OK 4 /* Test for read permission. */
    125121extern int access(const char *path, int amode);
    126122
     
    171167extern unsigned int alarm(unsigned int);
    172168
     169__C_DECLS_END;
     170
    173171#endif /* POSIX_UNISTD_H_ */
    174172
Note: See TracChangeset for help on using the changeset viewer.