Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
6c53d6ab
Commit
6c53d6ab
authored
Sep 08, 2021
by
Duncan Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use __typeof__ GNUC keyword for ISO C compatibility
parent
f1b89a20
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
8 deletions
+2
-8
src/cc-compat.h
+1
-7
src/util.h
+1
-1
No files found.
src/cc-compat.h
View file @
6c53d6ab
...
@@ -29,12 +29,6 @@
...
@@ -29,12 +29,6 @@
# endif
# endif
#endif
#endif
#ifdef __GNUC__
# define GIT_TYPEOF(x) (__typeof__(x))
#else
# define GIT_TYPEOF(x)
#endif
#if defined(__GNUC__)
#if defined(__GNUC__)
# define GIT_ALIGN(x,size) x __attribute__ ((aligned(size)))
# define GIT_ALIGN(x,size) x __attribute__ ((aligned(size)))
#elif defined(_MSC_VER)
#elif defined(_MSC_VER)
...
@@ -46,7 +40,7 @@
...
@@ -46,7 +40,7 @@
#if defined(__GNUC__)
#if defined(__GNUC__)
# define GIT_UNUSED(x) \
# define GIT_UNUSED(x) \
do { \
do { \
typeof(x) _unused __attribute__((unused));
\
__typeof__(x) _unused __attribute__((unused));
\
_unused = (x); \
_unused = (x); \
} while (0)
} while (0)
#else
#else
...
...
src/util.h
View file @
6c53d6ab
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
# define GIT_CONTAINER_OF(ptr, type, member) \
# define GIT_CONTAINER_OF(ptr, type, member) \
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_offsetof(type, member) == 0 && \
__builtin_offsetof(type, member) == 0 && \
__builtin_types_compatible_p(
typeof(&((type *) 0)->member), typeof
(ptr)), \
__builtin_types_compatible_p(
__typeof__(&((type *) 0)->member), __typeof__
(ptr)), \
((type *) (ptr)), \
((type *) (ptr)), \
(void)0)
(void)0)
#else
#else
...
...
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