basic/log: add a define for path relative to source root
When using build/ directory inside of the source directory: __FILE__: ../src/test/test-log.c RELATIVE_SOURCE_PATH: .. PROJECT_FILE: src/test/test-log.c When using a build directory outside of the source directory: __FILE__: ../../../home/zbyszek/src/systemd-work/src/test/test-log.c RELATIVE_SOURCE_PATH: ../../../home/zbyszek/src/systemd-work PROJECT_FILE: src/test/test-log.c
This commit is contained in:
@@ -73,6 +73,9 @@ int log_get_max_level_realm(LogRealm realm) _pure_;
|
||||
* for the application itself.
|
||||
*/
|
||||
|
||||
assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1)
|
||||
#define PROJECT_FILE (__FILE__ + STRLEN(RELATIVE_SOURCE_PATH) + 1)
|
||||
|
||||
int log_open(void);
|
||||
void log_close(void);
|
||||
void log_forget_fds(void);
|
||||
|
||||
Reference in New Issue
Block a user