*** ./server-client.c.ORIG Thu Apr 4 12:43:00 2013 --- ./server-client.c Thu Apr 4 12:43:27 2013 *************** *** 334,339 **** --- 334,351 ---- window_pane_mouse(wp, c->session, m); } + #ifdef _AIX + # define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ + } while (0) + #endif + /* Is this fast enough to probably be a paste? */ int server_client_assume_paste(struct session *s) *** ./Makefile.in.ORIG Mon Oct 13 17:13:38 2014 --- ./Makefile.in Mon Oct 13 17:13:57 2014 *************** *** 232,238 **** $(am__objects_14) $(am__objects_15) $(am__objects_16) \ $(am__objects_17) tmux_OBJECTS = $(dist_tmux_OBJECTS) $(nodist_tmux_OBJECTS) ! tmux_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false --- 232,238 ---- $(am__objects_14) $(am__objects_15) $(am__objects_16) \ $(am__objects_17) tmux_OBJECTS = $(dist_tmux_OBJECTS) $(nodist_tmux_OBJECTS) ! tmux_LDADD = $(LDADD) -lbsd AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false *** ./compat/forkpty-aix.c.ORIG Wed Jan 18 21:59:24 2017 --- ./compat/forkpty-aix.c Wed Jan 18 21:59:32 2017 *************** *** 26,32 **** #include "tmux.h" pid_t ! forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws) { int slave = -1, fd, pipe_fd[2]; char *path, dummy; --- 26,32 ---- #include "tmux.h" pid_t ! forkpty(int *master, __unused char *name, struct termios *tio, struct winsize *ws) { int slave = -1, fd, pipe_fd[2]; char *path, dummy; *** ./err.c.ORIG Wed Jan 18 22:05:08 2017 --- ./err.c Wed Jan 18 22:07:31 2017 *************** *** 0 **** --- 1,60 ---- + /***********************************************************/ + /* */ + /* AIX replacement functions: err(), errx() */ + /* */ + /***********************************************************/ + + #include + #include + #include + #include + #include + + + void err( int eval, const char *fmt, ... ) + { + va_list ap; + char *txt, *strp; + + + txt = strerror( errno ); + + if (fmt != NULL && strcmp( (void *) fmt, "" ) != 0 ) + { + strp = (char *) malloc( 1024 * sizeof( char ) ); + va_start( ap, fmt ); + vsnprintf( strp, 1023, fmt, ap ); + va_end( ap ); + + fprintf(stderr, "%s: %s\n", strp, txt); + free( strp ); + exit( eval ); + } + else + { + fprintf( stderr, "%s\n", txt); + free( txt ); + exit( eval ); + } + } + + + void errx( int eval, const char *fmt, ... ) + { + va_list ap; + char *strp; + + strp = (char *) malloc( 1024 * sizeof( char ) ); + + va_start( ap,fmt ); + vsnprintf( strp, 1023, fmt, ap ); + va_end( ap ); + + fprintf( stderr, "%s\n", strp ); + + free( strp ); + + exit( eval ); + } + + /***********************************************************/ *** ./tmux.c.ORIG Wed Jan 18 22:01:01 2017 --- ./tmux.c Wed Jan 18 22:05:04 2017 *************** *** 19,29 **** --- 19,35 ---- #include #include + #ifdef _AIX + #include "err.c" + #else #include + #endif #include #include #include + #ifndef _AIX #include + #endif #include #include #include