Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jens Gustedt
P99 - macros and functions for C99
Commits
faa6f16e
Commit
faa6f16e
authored
Dec 27, 2012
by
Jens Gustedt
Browse files
the conditional code for lifos is now in the corresponding header file
parent
b18a12d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
p99/p99_callback.h
View file @
faa6f16e
...
...
@@ -22,20 +22,11 @@
** @{
**/
#if defined(P99_LIFO_POP) || defined(P00_DOXYGEN)
# define p00_has_feature_callback_thread_safe 1
# define p00_has_extension_callback_thread_safe 1
#endif
typedef
struct
p00_cb_el
p00_cb_el
;
P99_POINTER_TYPE
(
p00_cb_el
);
#ifndef P00_DOXYGEN
# if p99_has_feature(callback_thread_safe)
P99_DECLARE_ATOMIC
(
p00_cb_el_ptr
);
typedef
_Atomic
(
p00_cb_el_ptr
)
p99_callback_stack
;
# else
typedef
p00_cb_el_ptr
p99_callback_stack
;
# endif
P99_LIFO_DECLARE
(
p00_cb_el_ptr
);
typedef
P99_LIFO
(
p00_cb_el_ptr
)
p99_callback_stack
;
#else
int
p00_doxygen_is_confused
(
void
)
{}
/**
...
...
@@ -109,24 +100,10 @@ P99_IF_LT(P99_NARG(__VA_ARGS__), 3) \
(p00_cb_el_init_(__VA_ARGS__, 0)) \
(p00_cb_el_init_(__VA_ARGS__))
p99_inline
p00_cb_el
*
p00_callback_top
(
p99_callback_stack
*
p00_l
)
{
#if p99_has_feature(callback_thread_safe)
return
P99_LIFO_TOP
(
p00_l
);
#else
return
*
p00_l
;
#endif
}
p99_inline
p00_cb_el
*
p00_callback_push
(
p99_callback_stack
*
p00_l
,
p00_cb_el
*
p00_el
)
{
if
(
p00_el
)
{
#if p99_has_feature(callback_thread_safe)
P99_LIFO_PUSH
(
p00_l
,
p00_el
);
#else
p00_el
->
p99_lifo
=
*
p00_l
;
*
p00_l
=
p00_el
;
#endif
}
return
p00_el
;
}
...
...
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