2022-01-24 03:28:16 +00:00
|
|
|
#ifndef LAIKA_LAIKA_H
|
|
|
|
#define LAIKA_LAIKA_H
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2022-01-31 21:54:39 +00:00
|
|
|
#include "lconfig.h"
|
|
|
|
|
2022-01-25 17:58:36 +00:00
|
|
|
#ifdef DEBUG
|
2022-04-28 16:07:11 +00:00
|
|
|
# define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout);
|
2022-01-25 17:58:36 +00:00
|
|
|
#else
|
2022-04-28 16:07:11 +00:00
|
|
|
# define LAIKA_DEBUG(...) ((void)0) /* no op */
|
|
|
|
#endif
|
|
|
|
|
2022-04-28 23:10:15 +00:00
|
|
|
#ifndef _MSC_VER
|
2022-04-28 16:07:11 +00:00
|
|
|
# define LAIKA_FORCEINLINE __attribute__((always_inline)) inline
|
|
|
|
#else
|
|
|
|
# define LAIKA_FORCEINLINE __forceinline
|
2022-01-25 17:58:36 +00:00
|
|
|
#endif
|
|
|
|
|
2022-05-17 15:37:58 +00:00
|
|
|
#define MIN(a, b) \
|
|
|
|
({ __typeof__ (a) _a = (a); \
|
|
|
|
__typeof__ (b) _b = (b); \
|
|
|
|
_a < _b ? _a : _b; })
|
|
|
|
|
|
|
|
#define MAX(a, b) \
|
|
|
|
({ __typeof__ (a) _a = (a); \
|
|
|
|
__typeof__ (b) _b = (b); \
|
|
|
|
_a > _b ? _a : _b; })
|
|
|
|
|
|
|
|
struct sLaika_peer;
|
|
|
|
struct sLaika_socket;
|
|
|
|
struct sLaika_pollList;
|
|
|
|
struct sLaika_task;
|
|
|
|
struct sLaika_taskService;
|
|
|
|
|
2022-01-24 03:28:16 +00:00
|
|
|
#endif
|