#include <stdio.h>
#include <unistd.h>
#include <time.h>
#define DEBUG_PRINT1(f, x) do {\
char buf[20]; struct tm tm_; time_t t = time(0); \
localtime_r(&t, &tm_); \
strftime(buf, sizeof buf, "%Y-%m-%dT%T", &tm_);\
fprintf(stderr, "%s [%s:" __FILE__ ":%d] " f "\n", buf, __func__, __LINE__, (x));\
} while (0)
#define D(x) DEBUG_PRINT1("%s", (x))
#define DD(f, x) DEBUG_PRINT1(#x " == " f, (x))
#define DX(x) do { D(#x); (x); } while (0)
int main(void)
{
D("test");
const char * str = "hogehoge";
D(str);
DX(puts("hoge"));
int a = 500;
DD("%d", a - 1);
return 0;
}