| 1 |
#ifndef RUBY_BACKWARD2_STDARG_H /*-*-C++-*-vi:se ft=cpp:*/ |
| 2 |
#define RUBY_BACKWARD2_STDARG_H |
| 3 |
/** |
| 4 |
* @file |
| 5 |
* @author Ruby developers <[email protected]> |
| 6 |
* @copyright This file is a part of the programming language Ruby. |
| 7 |
* Permission is hereby granted, to either redistribute and/or |
| 8 |
* modify this file, provided that the conditions mentioned in the |
| 9 |
* file COPYING are met. Consult the file for details. |
| 10 |
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are |
| 11 |
* implementation details. Don't take them as canon. They could |
| 12 |
* rapidly appear then vanish. The name (path) of this header file |
| 13 |
* is also an implementation detail. Do not expect it to persist |
| 14 |
* at the place it is now. Developers are free to move it anywhere |
| 15 |
* anytime at will. |
| 16 |
* @note To ruby-core: remember that this header can be possibly |
| 17 |
* recursively included from extension libraries written in C++. |
| 18 |
* Do not expect for instance `__VA_ARGS__` is always available. |
| 19 |
* We assume C99 for ruby itself but we don't assume languages of |
| 20 |
* extension libraries. They could be written in C++98. |
| 21 |
* @brief Defines old #_ |
| 22 |
* |
| 23 |
* Nobody should ever use these macros any longer. No known compilers lack |
| 24 |
* prototypes today. It's 21st century. Just forget them. |
| 25 |
*/ |
| 26 |
|
| 27 |
#undef _ |
| 28 |
/** |
| 29 |
* @deprecated Nobody practically needs this macro any longer. |
| 30 |
* @brief This was a transition path from K&R to ANSI. |
| 31 |
*/ |
| 32 |
#ifdef HAVE_PROTOTYPES |
| 33 |
# define _(args) args |
| 34 |
#else |
| 35 |
# define _(args) () |
| 36 |
#endif |
| 37 |
|
| 38 |
#undef __ |
| 39 |
/** |
| 40 |
* @deprecated Nobody practically needs this macro any longer. |
| 41 |
* @brief This was a transition path from K&R to ANSI. |
| 42 |
*/ |
| 43 |
#ifdef HAVE_STDARG_PROTOTYPES |
| 44 |
# define __(args) args |
| 45 |
#else |
| 46 |
# define __(args) () |
| 47 |
#endif |
| 48 |
|
| 49 |
/** |
| 50 |
* Functions declared using this macro take arbitrary arguments, including |
| 51 |
* void. |
| 52 |
* |
| 53 |
* ```CXX |
| 54 |
* void func(ANYARGS); |
| 55 |
* ``` |
| 56 |
* |
| 57 |
* This was a necessary evil when there was no such thing like function |
| 58 |
* overloading. But it is the 21st century today. People generally need not |
| 59 |
* use this. Just use a granular typed function. |
| 60 |
* |
| 61 |
* @see ruby::backward::cxxanyargs |
| 62 |
*/ |
| 63 |
#ifdef __cplusplus |
| 64 |
#define ANYARGS ... |
| 65 |
#else |
| 66 |
#define ANYARGS |
| 67 |
#endif |
| 68 |
|
| 69 |
#endif /* RUBY_BACKWARD2_STDARG_H */ |