diff options
author | sabetts <sabetts> | 2002-11-20 09:29:37 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2002-11-20 09:29:37 +0000 |
commit | d8b1104be304c1c67db4f16389696ea82a3e6699 (patch) | |
tree | 09e160a1339b2cccc700884419265234f2155f4b | |
parent | 34703b2c03d6f5eb15b9357d9ba6fc707944aa98 (diff) | |
download | ratpoison-d8b1104be304c1c67db4f16389696ea82a3e6699.zip |
* src/ratpoison.h[!HAVE_VARARG_MACROS]: PRINT_ERROR and
PRINT_DEBUG are defined as void macros.
* src/events.c (client_msg): Add semicolon to the end of a
PRINT_DEBUG line.
* src/actions.c (cmd_bind): typecast data as a (char *) before
using it in (char *) pointer arithmetic.
* configure.in: Add check to see if the preprocessor has variable
argument macro capabilities.
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | configure.in | 19 | ||||
-rw-r--r-- | src/actions.c | 2 | ||||
-rw-r--r-- | src/events.c | 2 | ||||
-rw-r--r-- | src/ratpoison.h | 13 |
6 files changed, 45 insertions, 4 deletions
@@ -22,3 +22,4 @@ Mike Meyer <mwm@mired.org> Ben Leslie <benno@sesgroup.net> Dan Aloni <da-x@gmx.net> Tim Goodwin <tjg@star.le.ac.uk> +Nicklas Lindgren <nili@lysator.liu.se> @@ -1,5 +1,17 @@ 2002-11-20 Shawn Betts <sabetts@sfu.ca> + * src/ratpoison.h[!HAVE_VARARG_MACROS]: PRINT_ERROR and + PRINT_DEBUG are defined as void macros. + + * src/events.c (client_msg): Add semicolon to the end of a + PRINT_DEBUG line. + + * src/actions.c (cmd_bind): typecast data as a (char *) before + using it in (char *) pointer arithmetic. + + * configure.in: Add check to see if the preprocessor has variable + argument macro capabilities. + * src/main.c (init_defaults): set pointer warping to on by default. diff --git a/configure.in b/configure.in index a98eeb5..97f9d94 100644 --- a/configure.in +++ b/configure.in @@ -17,7 +17,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl -dnl $Id: configure.in,v 1.30 2002/03/10 20:42:55 sabetts Exp $ +dnl $Id: configure.in,v 1.31 2002/11/20 09:29:37 sabetts Exp $ AC_INIT(src/main.c) AM_INIT_AUTOMAKE(ratpoison, 1.2.0-cvs) @@ -44,10 +44,25 @@ term_prog=$withval, term_prog="xterm") AC_DEFINE_UNQUOTED(TERM_PROG,"$term_prog") dnl Checks for programs. -CFLAGS="$CFLAGS -Wall -O2" AC_CHECK_TOOL(CC, gcc) AC_PROG_CC +if test "x$CC" = "xgcc"; then + CFLAGS="$CFLAGS -Wall -O2" +fi + +dnl Check for vararg macros (some preprocessors don't have variable argument macros) +AC_PROG_CPP +AC_MSG_CHECKING(for vararg macros) +AC_TRY_CPP([ +#define VARARGS(first, more...) foo(first, ## more) +VARARGS(bar, gazonk) +VARARGS(bar, gazonk, blahonga) +], AC_DEFINE_UNQUOTED(HAVE_VARARG_MACROS, "1", The c preprocessor has support for vararg macros) AC_MSG_RESULT(yes), +AC_MSG_RESULT(no)) + + + dnl check for an x terminal emulator AC_MSG_CHECKING(terminal emulator) AC_MSG_RESULT($term_prog) diff --git a/src/actions.c b/src/actions.c index 61c785c..2779101 100644 --- a/src/actions.c +++ b/src/actions.c @@ -455,7 +455,7 @@ cmd_bind (int interactive, void *data) keydesc = (char*) xmalloc (strlen (data) + 1); sscanf (data, "%s", keydesc); - cmd = data + strlen (keydesc); + cmd = ((char *)data) + strlen (keydesc); /* Gobble remaining whitespace before command starts */ while (*cmd == ' ') diff --git a/src/events.c b/src/events.c index e9f0db3..4004c61 100644 --- a/src/events.c +++ b/src/events.c @@ -330,7 +330,7 @@ client_msg (XClientMessageEvent *ev) { rp_window *win; - PRINT_DEBUG ("WM_CHANGE_STATE\n") + PRINT_DEBUG ("WM_CHANGE_STATE\n"); win = find_window (ev->window); if (win == NULL) return; diff --git a/src/ratpoison.h b/src/ratpoison.h index 293e868..99b6409 100644 --- a/src/ratpoison.h +++ b/src/ratpoison.h @@ -33,6 +33,11 @@ /* Some error reporting macros */ #define PRE_PRINT_LOCATION fprintf (stderr, "%s:%s():%d: ", __FILE__, __FUNCTION__, __LINE__); + +/* FIXME: Some preprocessors don't have variable args. In that case + they don't get error or debugging output. */ +#ifdef HAVE_VARARG_MACROS + #define PRINT_ERROR(format, args...) \ { fprintf (stderr, PACKAGE ":error -- "); PRE_PRINT_LOCATION; fprintf (stderr, format, ## args); } @@ -44,6 +49,14 @@ # define PRINT_DEBUG(format, args...) #endif /* DEBUG */ +#else /* !HAVE_VARARG_MACROS */ + +#define PRINT_ERROR (void) +#define PRINT_DEBUG (void) + +#endif /* HAVE_VARARG_MACROS */ + + extern XGCValues gv; #include "conf.h" |