/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
 *
 * n4: A fast userspace NFSv4 server.
 * $Id: util.h,v 1.3 2001/06/01 07:01:19 mbp Exp $
 * 
 * Copyright (C) 2001 by Martin Pool <mbp@samba.org>
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifdef __GNUC__
#  define UNUSED(x) x __attribute__((unused))
#elif __LCLINT__
#  define UNUSED(x) /*@unused@*/ x
#else				/* !__GNUC__ && !__LCLINT__ */
#  define UNUSED(x) x
#endif				/* !__GNUC__ && !__LCLINT__ */

/* This is only used by `make proto', not by the compiler.  It must
   occur at the start of the line for function declarations that want
   an automatic prototype. */
#define MKPROTO 
#define NOPROTO

/* We have a common idiom of checking for errors and returning if so.
   Doing this in a macro is kind of ugly, but better than wearing out
   my typing fingers. */
#define CHECK_ERR(cond) do { n4err _Xerr; if ((_Xerr = (cond))) return _Xerr; } while (0)

#define CHECK_OUT(cond) do { if ((err = (cond))) goto OUT; } while (0)
