2016-12-06 15:30:46 -05:00
|
|
|
#ifndef SOURCE_MACROS_HPP
|
|
|
|
#define SOURCE_MACROS_HPP
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
// Helper macros, don't use these ones
|
|
|
|
// STRIP the OSRM_PROJECT_DIR from the front of a filename. Expected to come
|
|
|
|
// from CMake's CURRENT_SOURCE_DIR, which doesn't have a trailing /, hence the +1
|
2017-01-06 07:21:54 -05:00
|
|
|
#define PROJECT_RELATIVE_PATH_(x) std::string(x).substr(strlen(OSRM_PROJECT_DIR) + 1)
|
2016-12-06 15:30:46 -05:00
|
|
|
// Return the path of a file, relative to the OSRM_PROJECT_DIR
|
2017-01-06 07:21:54 -05:00
|
|
|
#define OSRM_SOURCE_FILE_ PROJECT_RELATIVE_PATH_(__FILE__)
|
2016-12-06 15:30:46 -05:00
|
|
|
|
|
|
|
// This is the macro to use
|
2017-05-27 00:16:20 -04:00
|
|
|
#define SOURCE_REF OSRM_SOURCE_FILE_ + ":" + std::to_string(__LINE__)
|
2016-12-06 15:30:46 -05:00
|
|
|
|
2017-01-06 07:21:54 -05:00
|
|
|
#endif // SOURCE_MACROS_HPP
|