shithub: sl

ref: dc4a648a71627db05ba1c24557c0ab7f80d348ed
dir: /src/macos/platform.h/

View raw version
#pragma once

#define _XOPEN_SOURCE 700
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <stdbool.h>
#include <stdarg.h>
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <wctype.h>
#include <wchar.h>

#define __os_name__ "macos"
extern char os_version[];
#define __os_version__ os_version

#define nil NULL
#define USED(x) ((void)(x))
#define nelem(x) (int)(sizeof(x)/sizeof((x)[0]))

typedef jmp_buf sl_jmp_buf;
#define sl_setjmp(e) setjmp((e))
#define sl_longjmp(e, v) longjmp((e), (v))
#define exits(status) do{ \
	const char *s = (status); \
	exit(s == nil ? 0 : 1); \
}while(0)
#define sysfatal(...) do{ \
	fprintf(stderr, __VA_ARGS__); \
	exit(1); \
}while(0)

#define PATHSEP '/'
#define PATHSEPSTRING "/"
#define PATHLISTSEP ':'
#define PATHLISTSEPSTRING ":"
#define ISPATHSEP(c) ((c) == '/')

#define HEAP_SIZE0 128*1024
#define STACK_SIZE0 8*1024

#include "cc_gnuc.h"
#include "mem_dlmalloc.h"
#include "mem.h"
#include "mp.h"
#include "utf.h"