Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define OP(a,b,op) ((a)op(b))
- #define MKFUNC_a_op_b(type, opname, op) void type##_##opname##_##type(const void *a, const void *b, void *out) \
- {\
- type tmp = OP(*(type*)a,*(type*)b,op);\
- memcpy(out,(void*)(&tmp),sizeof(type));\
- }\
- MKFUNC_a_op_b(char,plus,+)
- MKFUNC_a_op_b(char,minus,-)
- MKFUNC_a_op_b(char,div,/)
- MKFUNC_a_op_b(char,mod,%)
- MKFUNC_a_op_b(float,plus,+)
- MKFUNC_a_op_b(float,minus,-)
- MKFUNC_a_op_b(float,div,/)
- MKFUNC_a_op_b(float,mod,%)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement