You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Structure describing the action to be taken when a signal arrives. */
struct sigaction
{
/* Signal handler. */
#ifdef __USE_POSIX199309
union
{
/* Used if SA_SIGINFO is not set. */
__sighandler_t sa_handler;
/* Used if SA_SIGINFO is set. */
void (*sa_sigaction) (int, siginfo_t *, void *);
}
__sigaction_handler;
#define sa_handler __sigaction_handler.sa_handler
#define sa_sigaction __sigaction_handler.sa_sigaction
#else
__sighandler_t sa_handler;
#endif
/* Additional set of signals to be blocked. */
__sigset_t sa_mask;
/* Special flags. */
int sa_flags;
/* Restore handler. */
void (*sa_restorer) (void);
};
I think there's been a misunderstanding about what d++ is supposed to do. The "inner defines" aren't supposed to be translated as aliases - they get used as-is, as macros. One could use them in C program as follows:
Which compiles fine. Notice that sa_sigaction was used just the same as it was in the C program.
As for how the sigaction function gets translated, that's exactly as intended since there's a name collision with the struct of the same name. In C++ one can use struct sigaction to disambiguate, and in C it's necessary. There's no equivalent construct in D.
On my Ubuntu system,
sigaction
is defined as:but it ends up as:
So,
__USE_POSIX199309
ifdef is expanded (there's__sigaction__handler
generated), but the inner defines are not expanded into aliases.The text was updated successfully, but these errors were encountered: