X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsystemd%2Fsd-shutdown.h;h=1d65549882cfe743848cef0b13e3e2b5bc0fa7ef;hb=3fa5dd6de798e17d93531bc900b8e2dc587c38f3;hp=cee435017338d289ee94d1a6137919ad5707dcea;hpb=f274ece0f76b5709408821e317e87aef76123db6;p=elogind.git diff --git a/src/systemd/sd-shutdown.h b/src/systemd/sd-shutdown.h index cee435017..1d6554988 100644 --- a/src/systemd/sd-shutdown.h +++ b/src/systemd/sd-shutdown.h @@ -26,6 +26,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _sd_packed_ +# define _sd_packed_ __attribute__((packed)) +#endif + typedef enum sd_shutdown_mode { SD_SHUTDOWN_NONE = 0, SD_SHUTDOWN_REBOOT = 'r', @@ -37,7 +45,7 @@ typedef enum sd_shutdown_mode { /* Calculate the size of the message as "offsetof(struct * sd_shutdown_command, wall_message) + * strlen(command.wall_message)" */ -__attribute__((packed)) struct sd_shutdown_command { +struct sd_shutdown_command { /* Microseconds after the epoch 1970 UTC */ uint64_t usec; @@ -55,7 +63,7 @@ __attribute__((packed)) struct sd_shutdown_command { /* The wall message to send around. Leave empty for the * default wall message */ char wall_message[]; -}; +} _sd_packed_; /* The scheme is very simple: * @@ -105,4 +113,8 @@ __attribute__((packed)) struct sd_shutdown_command { * anybody. */ +#ifdef __cplusplus +} +#endif + #endif