compat/* should not include tmux.h.

pull/746/head
Nicholas Marriott 2017-01-25 13:49:01 +00:00
parent 418ab1a553
commit 3e495b4001
24 changed files with 34 additions and 31 deletions

View File

@ -17,6 +17,12 @@
#ifndef COMPAT_H
#define COMPAT_H
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#include <stdio.h>
#ifndef __GNUC__
#define __attribute__(a)
#endif
@ -62,6 +68,12 @@ typedef uint64_t u_int64_t;
#define pledge(s, p) (0)
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#include <inttypes.h>
#endif
#ifdef HAVE_QUEUE_H
#include <sys/queue.h>
#else
@ -108,12 +120,6 @@ typedef uint64_t u_int64_t;
#include "compat/imsg.h"
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#include <inttypes.h>
#endif
#ifdef BROKEN_CMSG_FIRSTHDR
#undef CMSG_FIRSTHDR
#define CMSG_FIRSTHDR(mhdr) \

View File

@ -23,8 +23,6 @@
#endif
#include <string.h>
#include "tmux.h"
int
asprintf(char **ret, const char *fmt, ...)
{

View File

@ -17,7 +17,7 @@
#include <string.h>
#include "tmux.h"
#include "compat.h"
void
cfmakeraw(struct termios *tio)

View File

@ -45,7 +45,7 @@
# endif
#endif
#include "tmux.h"
#include "compat.h"
#ifndef OPEN_MAX
# define OPEN_MAX 256

View File

@ -32,7 +32,7 @@
#include <unistd.h>
#include <stdlib.h>
#include "tmux.h"
#include "compat.h"
int
daemon(int nochdir, int noclose)

View File

@ -22,7 +22,7 @@
#include <stdlib.h>
#include <errno.h>
#include "tmux.h"
#include "compat.h"
char *
fgetln(FILE *fp, size_t *len)

View File

@ -23,7 +23,7 @@
#include <unistd.h>
#include <errno.h>
#include "tmux.h"
#include "compat.h"
pid_t
forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws)

View File

@ -22,7 +22,7 @@
#include <stropts.h>
#include <unistd.h>
#include "tmux.h"
#include "compat.h"
pid_t
forkpty(int *master, char *name, struct termios *tio, struct winsize *ws)

View File

@ -23,7 +23,7 @@
#include <stropts.h>
#include <unistd.h>
#include "tmux.h"
#include "compat.h"
pid_t
forkpty(int *master, char *name, struct termios *tio, struct winsize *ws)

View File

@ -38,7 +38,7 @@
#include <string.h>
#include <stdlib.h>
#include "tmux.h"
#include "compat.h"
/*
* fparseln() specific operation flags.

View File

@ -29,7 +29,7 @@
/* OPENBSD ORIGINAL: lib/libc/stdlib/getopt.c */
#include "tmux.h"
#include "compat.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -16,7 +16,7 @@
#include <sys/types.h>
#include "tmux.h"
#include "compat.h"
#if defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME)
const char *

View File

@ -26,7 +26,7 @@
#include <string.h>
#include <unistd.h>
#include "tmux.h"
#include "compat.h"
#include "imsg.h"
int ibuf_realloc(struct ibuf *, size_t);

View File

@ -25,7 +25,7 @@
#include <string.h>
#include <unistd.h>
#include "tmux.h"
#include "compat.h"
#include "imsg.h"
int imsg_fd_overhead = 0;

View File

@ -18,8 +18,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "tmux.h"
#ifndef _IMSG_H_
#define _IMSG_H_

View File

@ -20,7 +20,7 @@
#include <stdint.h>
#include <stdlib.h>
#include "tmux.h"
#include "compat.h"
/*
* This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX

View File

@ -18,7 +18,7 @@
#include <stdlib.h>
#include <string.h>
#include "tmux.h"
#include "compat.h"
int
setenv(const char *name, const char *value, unused int overwrite)

View File

@ -16,9 +16,10 @@
#include <sys/types.h>
#include <stdarg.h>
#include <string.h>
#include "tmux.h"
#include "compat.h"
#if defined(HAVE_PRCTL) && defined(HAVE_PR_SET_NAME)

View File

@ -19,7 +19,7 @@
#include <sys/types.h>
#include <string.h>
#include "tmux.h"
#include "compat.h"
/*
* Appends src to string dst of size siz (unlike strncat, siz is the

View File

@ -19,7 +19,7 @@
#include <sys/types.h>
#include <string.h>
#include "tmux.h"
#include "compat.h"
/*
* Copy src to string dst of size siz. At most siz-1 characters

View File

@ -21,7 +21,7 @@
#include <limits.h>
#include <stdlib.h>
#include "tmux.h"
#include "compat.h"
#define INVALID 1
#define TOOSMALL 2

View File

@ -31,7 +31,7 @@
#include <sys/types.h>
#include <ctype.h>
#include "tmux.h"
#include "compat.h"
/*
* decode driven by state machine

View File

@ -18,7 +18,7 @@
#include <utf8proc.h>
#include "tmux.h"
#include "compat.h"
int
utf8proc_wcwidth(wchar_t wc)

View File

@ -35,7 +35,7 @@
#include <string.h>
#include <stdlib.h>
#include "tmux.h"
#include "compat.h"
#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
#define isvisible(c,flag) \