2022-01-24 03:28:16 +00:00
|
|
|
#ifndef LAIKA_LAIKA_H
|
|
|
|
#define LAIKA_LAIKA_H
|
|
|
|
|
2022-06-27 23:57:00 +00:00
|
|
|
#include "lconfig.h"
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2022-01-24 03:28:16 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
2022-06-27 23:57:00 +00:00
|
|
|
#include <stdlib.h>
|
2022-01-24 03:28:16 +00:00
|
|
|
#include <string.h>
|
2022-06-28 00:02:49 +00:00
|
|
|
#include <inttypes.h>
|
2022-01-24 03:28:16 +00:00
|
|
|
|
2022-10-06 01:36:49 +00:00
|
|
|
#ifdef LAIKA_DEBUG_BUILD
|
2022-06-27 23:57:00 +00:00
|
|
|
# define LAIKA_DEBUG(...) \
|
|
|
|
printf("[~] " __VA_ARGS__); \
|
|
|
|
fflush(stdout);
|
2022-01-25 17:58:36 +00:00
|
|
|
#else
|
2022-06-27 23:57:00 +00:00
|
|
|
# define LAIKA_DEBUG(...) ((void)0) /* no op */
|
2022-04-28 16:07:11 +00:00
|
|
|
#endif
|
|
|
|
|
2022-04-28 23:10:15 +00:00
|
|
|
#ifndef _MSC_VER
|
2022-06-27 23:57:00 +00:00
|
|
|
# define LAIKA_FORCEINLINE __attribute__((always_inline)) inline
|
2022-04-28 16:07:11 +00:00
|
|
|
#else
|
2022-06-27 23:57:00 +00:00
|
|
|
# define LAIKA_FORCEINLINE __forceinline
|
2022-01-25 17:58:36 +00:00
|
|
|
#endif
|
|
|
|
|
2022-06-27 23:57:00 +00:00
|
|
|
LAIKA_FORCEINLINE int MIN(int a, int b)
|
|
|
|
{
|
2022-05-18 19:12:20 +00:00
|
|
|
return a < b ? a : b;
|
|
|
|
}
|
|
|
|
|
2022-06-27 23:57:00 +00:00
|
|
|
LAIKA_FORCEINLINE int MAX(int a, int b)
|
|
|
|
{
|
2022-05-18 19:12:20 +00:00
|
|
|
return a > b ? a : b;
|
|
|
|
}
|
2022-05-17 15:37:58 +00:00
|
|
|
|
|
|
|
struct sLaika_peer;
|
|
|
|
struct sLaika_socket;
|
|
|
|
struct sLaika_pollList;
|
|
|
|
struct sLaika_task;
|
|
|
|
struct sLaika_taskService;
|
|
|
|
|
2022-01-24 03:28:16 +00:00
|
|
|
#endif
|