Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaudi
Gaudi
Commits
2bb5ff8c
Commit
2bb5ff8c
authored
2 years ago
by
Valentin Volkl
Browse files
Options
Downloads
Patches
Plain Diff
use working source_location
parent
146f4171
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1404
Workaround for missing std::source_location in apple-clang
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiPluginService/include/Gaudi/PluginServiceV2.h
+38
-6
38 additions, 6 deletions
GaudiPluginService/include/Gaudi/PluginServiceV2.h
with
38 additions
and
6 deletions
GaudiPluginService/include/Gaudi/PluginServiceV2.h
+
38
−
6
View file @
2bb5ff8c
...
...
@@ -23,24 +23,56 @@
#include
<type_traits>
#include
<typeinfo>
#include
<utility>
#include
<cstdint>
#if __cplusplus > 201703L && __has_include( <source_location> )
# include <source_location>
namespace
Gaudi
::
PluginService
::
Details
{
using
std
::
source_location
;
}
#elif __cplusplus >= 201402L && __has_include( <experimental/source_location> ) && false
#elif __cplusplus >= 201402L && __has_include( <experimental/source_location> ) && false //TODO: false for debugging, turn on again
# include <experimental/source_location>
namespace
Gaudi
::
PluginService
::
Details
{
using
std
::
experimental
::
source_location
;
}
#else
namespace
Gaudi
::
PluginService
::
Details
{
struct
source_location
{
std
::
string
file_name
()
{
return
""
;};
std
::
string
line
()
{
return
""
;}
static
constexpr
source_location
current
()
{
return
source_location
();}
};
struct
source_location
{
// 14.1.2, source_location creation
static
constexpr
source_location
current
(
const
char
*
__file
=
__builtin_FILE
(),
const
char
*
__func
=
__builtin_FUNCTION
(),
int
__line
=
__builtin_LINE
(),
int
__col
=
0
)
noexcept
{
source_location
__loc
;
__loc
.
_M_file
=
__file
;
__loc
.
_M_func
=
__func
;
__loc
.
_M_line
=
__line
;
__loc
.
_M_col
=
__col
;
return
__loc
;
}
constexpr
source_location
()
noexcept
:
_M_file
(
"unknown"
),
_M_func
(
_M_file
),
_M_line
(
0
),
_M_col
(
0
)
{
}
// 14.1.3, source_location field access
constexpr
uint_least32_t
line
()
const
noexcept
{
return
_M_line
;
}
constexpr
uint_least32_t
column
()
const
noexcept
{
return
_M_col
;
}
constexpr
const
char
*
file_name
()
const
noexcept
{
return
_M_file
;
}
constexpr
const
char
*
function_name
()
const
noexcept
{
return
_M_func
;
}
private
:
const
char
*
_M_file
;
const
char
*
_M_func
;
uint_least32_t
_M_line
;
uint_least32_t
_M_col
;
};
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment