Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rlib
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
rlib
Commits
a25cb100
There was an error fetching the commit references. Please try again later.
Unverified
Commit
a25cb100
authored
7 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
update macro prefix
parent
42bc4e5c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
LICENSE
+1
-1
1 addition, 1 deletion
LICENSE
macro.hpp
+19
-14
19 additions, 14 deletions
macro.hpp
scope_guard.hpp
+1
-1
1 addition, 1 deletion
scope_guard.hpp
with
21 additions
and
16 deletions
LICENSE
+
1
−
1
View file @
a25cb100
MIT License
Copyright (c) 2017 Recolic Keghart
Copyright (c) 2017
-2018
Recolic Keghart
<root@recolic.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
This diff is collapsed.
Click to expand it.
macro.hpp
+
19
−
14
View file @
a25cb100
#ifndef R_MACRO_HPP
#define R_MACRO_HPP
#if
n
def
MACRO_DECAY
#def
ine MACRO_DECAY(m) (m)
#ifdef
RLIB_EMPTY_MACRO
#
un
def
RLIB_EMPTY_MACRO
#endif
#define RLIB_EMPTY_MACRO
#ifndef
_
R_MACRO_
ENSTRING
#define
_
R_MACRO_
ENSTRING(_s) #_s
#ifndef R
LIB
_MACRO_
DECAY
#define R
LIB
_MACRO_
DECAY(m) (m)
#endif
#ifndef
MACRO_TO_CSTR
#define
MACRO_TO_CSTR(m) _R
_MACRO_ENSTRING(
m)
#ifndef
_RLIB_MACRO_ENSTRING
#define
_RLIB
_MACRO_ENSTRING(
_s) #_s
#endif
#ifndef MACRO_
EQL
#define
MACRO_EQL(a, b) (
MACRO_TO_CSTR(
a
)
== MACRO_TO_CSTR(b)
)
#ifndef
RLIB_
MACRO_
TO_CSTR
#define
RLIB_
MACRO_TO_CSTR(
m
)
_RLIB_MACRO_ENSTRING(m
)
#endif
#ifndef MACRO_CAT
#define MACRO_CAT(a, b) _MACRO_CAT_I(a, b)
#define _MACRO_CAT_I(a, b) _MACRO_CAT_II(~, a ## b)
#define _MACRO_CAT_II(p, res) res
//#ifndef RLIB_MACRO_EQL
//#define RLIB_MACRO_EQL(a, b) (RLIB_MACRO_TO_CSTR(a) == RLIB_MACRO_TO_CSTR(b))
//#endif
#ifndef RLIB_MACRO_CAT
#define RLIB_MACRO_CAT(a, b) _RLIB_MACRO_CAT_I(a, b)
#define _RLIB_MACRO_CAT_I(a, b) _RLIB_MACRO_CAT_II(~, a ## b)
#define _RLIB_MACRO_CAT_II(p, res) res
#endif
#ifndef MAKE_UNIQUE_NAME
#define MAKE_UNIQUE_NAME(base) MACRO_CAT(base, __COUNTER__)
#ifndef
RLIB_
MAKE_UNIQUE_NAME
#define
RLIB_
MAKE_UNIQUE_NAME(base)
RLIB_
MACRO_CAT(base, __COUNTER__)
#endif
#endif
This diff is collapsed.
Click to expand it.
scope_guard.hpp
+
1
−
1
View file @
a25cb100
...
...
@@ -47,7 +47,7 @@ namespace rlib {
#ifndef defer
#include
<rlib/macro.hpp>
#define defer(callable) ::rlib::scope_guard MAKE_UNIQUE_NAME(_guarder_id_) (callable)
#define defer(callable) ::rlib::scope_guard
RLIB_
MAKE_UNIQUE_NAME(_guarder_id_) (callable)
#endif
#define reinforce_scope_begin(guarderName, callable) scope_guard guarderName = callable; try{
...
...
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