#ifndef LINK_FEATURES_H
#define LINK_FEATURES_H

#if defined(_MSC_VER) && !defined(LINK_GRAMMAR_DLL_EXPORT)
#define LINK_GRAMMAR_DLL_EXPORT 1
#endif

#ifdef  __cplusplus
# define LINK_BEGIN_DECLS  extern "C" {
# define LINK_END_DECLS    }
#else
# define LINK_BEGIN_DECLS
# define LINK_END_DECLS
#endif

#ifndef link_public_api
# if defined(_MSC_VER) && !defined(LINK_GRAMMAR_STATIC)
#  if !defined LINK_GRAMMAR_DLL_EXPORT
#   error !defined LINK_GRAMMAR_DLL_EXPORT
#  endif
#  if LINK_GRAMMAR_DLL_EXPORT
#   define link_public_api(x) __declspec(dllexport) x
#  else
#   define link_public_api(x) __declspec(dllimport) x
#  endif
# else
#  define link_public_api(x) x
# endif
#endif

#define LINK_MAJOR_VERSION @LINK_MAJOR_VERSION@
#define LINK_MINOR_VERSION @LINK_MINOR_VERSION@
#define LINK_MICRO_VERSION @LINK_MICRO_VERSION@

#define LINK_VERSION_STRING "@LINK_MAJOR_VERSION@.@LINK_MINOR_VERSION@.@LINK_MICRO_VERSION@"

/* __VA_ARGS__ must be used because arguments may contain commas. */
#define lg_xstr(...) lg_str(__VA_ARGS__)
#define lg_str(...) #__VA_ARGS__

#define LG_HOST_OS lg_str(@HOST_OS@)
#define LG_CPPFLAGS "CPPFLAGS=" lg_str(@CPPFLAGS@)
#define LG_CFLAGS "CFLAGS=" lg_str(@CFLAGS@)
#define LG_DEFS lg_str(@LG_DEFS@)

#define DISCUSSION_GROUP "@DISCUSSION_GROUP@"
#define OVERVIEW "@OVERVIEW@"
/* Must appear here to support Windows. */
#undef PACKAGE_BUGREPORT
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
#undef PACKAGE_URL
#define PACKAGE_URL "@PACKAGE_URL@"

#endif
