Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
219a756a
Commit
219a756a
authored
Nov 18, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler.h: drop gcc_alignas(), use plain C++11 alignas()
parent
2f76f9da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
Compiler.h
src/Compiler.h
+0
-8
Manual.hxx
src/util/Manual.hxx
+1
-1
test_byte_reverse.cxx
test/test_byte_reverse.cxx
+4
-4
No files found.
src/Compiler.h
View file @
219a756a
...
...
@@ -160,14 +160,6 @@
#define gcc_restrict
#endif
/* C++11 features */
#if defined(__cplusplus)
#define gcc_alignas(T, fallback) alignas(T)
#endif
#ifndef __has_feature
// define dummy macro for non-clang compilers
#define __has_feature(x) 0
...
...
src/util/Manual.hxx
View file @
219a756a
...
...
@@ -50,7 +50,7 @@
*/
template
<
class
T
>
class
Manual
{
gcc_alignas
(
T
,
8
)
alignas
(
T
)
char
data
[
sizeof
(
T
)];
#ifndef NDEBUG
...
...
test/test_byte_reverse.cxx
View file @
219a756a
...
...
@@ -49,9 +49,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ByteReverseTest);
void
ByteReverseTest
::
TestByteReverse2
()
{
static
const
char
src
[]
gcc_alignas
(
uint16_t
,
2
)
=
"123456"
;
static
const
char
src
[]
alignas
(
uint16_t
)
=
"123456"
;
static
const
char
result
[]
=
"214365"
;
static
uint8_t
dest
[
ARRAY_SIZE
(
src
)]
gcc_alignas
(
uint16_t
,
2
);
static
uint8_t
dest
[
ARRAY_SIZE
(
src
)]
alignas
(
uint16_t
);
reverse_bytes
(
dest
,
(
const
uint8_t
*
)
src
,
(
const
uint8_t
*
)(
src
+
ARRAY_SIZE
(
src
)
-
1
),
2
);
...
...
@@ -73,9 +73,9 @@ ByteReverseTest::TestByteReverse3()
void
ByteReverseTest
::
TestByteReverse4
()
{
static
const
char
src
[]
gcc_alignas
(
uint32_t
,
4
)
=
"12345678"
;
static
const
char
src
[]
alignas
(
uint32_t
)
=
"12345678"
;
static
const
char
result
[]
=
"43218765"
;
static
uint8_t
dest
[
ARRAY_SIZE
(
src
)]
gcc_alignas
(
uint32_t
,
4
);
static
uint8_t
dest
[
ARRAY_SIZE
(
src
)]
alignas
(
uint32_t
);
reverse_bytes
(
dest
,
(
const
uint8_t
*
)
src
,
(
const
uint8_t
*
)(
src
+
ARRAY_SIZE
(
src
)
-
1
),
4
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment