Skip to content

defs

jdirs: Quadruplet with four directions

Fields:

  • uint8_t top

  • uint8_t right

  • uint8_t bottom

  • uint8_t left

struct jdirs {
uint8_t top;
uint8_t right;
uint8_t bottom;
uint8_t left;
};

jrect: Small rectangle

Fields:

  • int16_t x, y

  • int16_t w, h

struct jrect {
int16_t x, y;
int16_t w, h;
};

and accepts from 1 to 4 parameters.

#define J_CAST0(x) _Pragma("GCC error \"J_CAST takes only up to 4 arguments\"")

#define J_CAST1(x, ...) jwidget *x = x ## 0; __VA_OPT__(J_CAST0(__VA_ARGS__))

#define J_CAST2(x, ...) jwidget *x = x ## 0; __VA_OPT__(J_CAST1(__VA_ARGS__))

#define J_CAST3(x, ...) jwidget *x = x ## 0; __VA_OPT__(J_CAST2(__VA_ARGS__))

#define J_CAST(x, ...) jwidget *x = x ## 0; __VA_OPT__(J_CAST3(__VA_ARGS__))

Implementation is in the gint source tree.