/*+JMJ
 * krcompat.h - definitons for C source compatible with both ANSI
 *              and K&R compilers
 * March 18, 2011 David Meyer <papa@freeshell.org>
 *
 * USAGE
 *
 * 1. Prototype *all* functions 
 * 2. Use PROTPARM macro for prototype argument lists. 
 * 3. Use K&R-style function declarations.
 * 4. Declare void * pointers as void_ptr.
 *
 * (Reference also specifies method for handling variadic functions
 * that is not implemented here.)
 *
 * REFERENCE
 *
 * Vaughan, Eliston, Tromey, Taylor. "GNU Autoconf, Automake, and 
 * Libtool -- 9.1.6 K&R Compilers". sourceware.org. Feb. 8, 2006. 
 * Sams Publishing. Accessed Mar. 18, 2011 
 * <http://sources.redhat.com/autobook/autobook/autobook_51.html>.
 */

#pragma once
#ifndef KRCOMPAT_H
#define KRCOMPAT_H

#if __STDC__
#  ifndef NOPROTOS
#    define PROTPARM(args) args
#  endif
#endif
#ifndef PROTPARM
#  define PROTPARM(args) ()
#endif

#if __STDC__
typedef void *void_ptr;
#else
typedef char *void_ptr;
#endif

#endif