shithub: sl

ref: 8a26e53e24fd1fca9cc2ff6e60d60d69c25d602f
dir: /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>
#include "mem.h"

#define __os_name__ "macos"

#define sadd_overflow __builtin_add_overflow
#define sadd_overflow_64 __builtin_add_overflow
#define smul_overflow_64 __builtin_mul_overflow

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

#ifdef __GNUC__
#define __unlikely(x) __builtin_expect(!!(x), 0)
#define __likely(x) __builtin_expect(!!(x), 1)
#define __printfmt(x, y) __attribute__((format(printf, x, y)))
#endif

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

#ifndef BYTE_ORDER
#error unknown byte order
#endif