Introduce generic STRINGIFY and STRINGIFY_VAL macros
* macros.h (STRINGIFY, STRINGIFY_VAL): New macros. * mpers_type.h: Include "macros.h". [IN_MPERS] (STRINGIFY): Remove. * tests/sockname.c (TEST_SYSCALL_STR__, TEST_SYSCALL_STR_): Remove. (TEST_SYSCALL_STR): Use STRINGIFY_VAL. Co-authored-by: Victor Krapivensky <krapivenskiy.va@phystech.edu>
This commit is contained in:
parent
38198609df
commit
eaa2f6e06d
3
macros.h
3
macros.h
@ -32,4 +32,7 @@
|
|||||||
|
|
||||||
#define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
|
#define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
|
||||||
|
|
||||||
|
#define STRINGIFY(...) #__VA_ARGS__
|
||||||
|
#define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__)
|
||||||
|
|
||||||
#endif /* !STRACE_MACROS_H */
|
#endif /* !STRACE_MACROS_H */
|
||||||
|
@ -30,8 +30,9 @@
|
|||||||
#ifndef STRACE_MPERS_TYPE_H
|
#ifndef STRACE_MPERS_TYPE_H
|
||||||
#define STRACE_MPERS_TYPE_H
|
#define STRACE_MPERS_TYPE_H
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
#ifdef IN_MPERS
|
#ifdef IN_MPERS
|
||||||
# define STRINGIFY(a) #a
|
|
||||||
# define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
|
# define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
|
||||||
# ifdef MPERS_IS_m32
|
# ifdef MPERS_IS_m32
|
||||||
# define MPERS_PREFIX m32_
|
# define MPERS_PREFIX m32_
|
||||||
|
@ -42,9 +42,7 @@
|
|||||||
# error TEST_SYSCALL_NAME must be defined
|
# error TEST_SYSCALL_NAME must be defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TEST_SYSCALL_STR__(a) #a
|
#define TEST_SYSCALL_STR STRINGIFY_VAL(TEST_SYSCALL_NAME)
|
||||||
#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a)
|
|
||||||
#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME)
|
|
||||||
#define TEST_SOCKET TEST_SYSCALL_STR ".socket"
|
#define TEST_SOCKET TEST_SYSCALL_STR ".socket"
|
||||||
|
|
||||||
#ifdef TEST_SYSCALL_PREPARE
|
#ifdef TEST_SYSCALL_PREPARE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user