templates/c/main.c

17 lines
395 B
C
Raw Normal View History

2024-05-06 21:40:01 +00:00
#include <stdlib.h>
#include <unistd.h>
#define lengthof(sstr) (sizeof (sstr) / sizeof *(sstr))
#define sstr_len(sstr) (lengthof(sstr) - 1)
#define sstr_unpack(sstr) (sstr), (sstr_len(sstr))
static const char GREETING[] = "hello, world!\n";
int main(void)
{
return (
write(STDOUT_FILENO, sstr_unpack(GREETING))
== sstr_len(GREETING)
) ? EXIT_SUCCESS : EXIT_FAILURE;
}