print [@ /***** Generated by scconfig - DO NOT EDIT *****/

/* Source: config.h.in; to regenerate run ./configure */

#ifndef RND_CONFIG_H
#define RND_CONFIG_H

/****************************************************************************/
/* Static defines to enable extra features on some systems; once we get
   testers on those systems, we can remove them and see if scconfig figured
   everything. */

/* Enable extensions on AIX 3, Interix.  */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable threading extensions on Solaris.  */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop.  */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris.  */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif

/****************************************************************************/
/* These ones are already autodetected by scconfig */
@]

print {\n\n/* Macro to add a funciton attribute to suppress "function unused" for static inline functions declared in .h files */\n}
print_ternary ?cc/func_attr/unused/presents {#define RND_FUNC_UNUSED __attribute__((unused))} {#define RND_FUNC_UNUSED}

print {\n\n/* [4.3.0] defined if "inline" is available */\n}
print_ternary ?cc/inline {#define RND_HAS_INLINE 1} {#undef RND_HAS_INLINE}

print {\n\n/* inline, as detected ("inline" or empty) */\n}
print_ternary ?cc/inline {#define RND_INLINE_DETECTED inline} {#define RND_INLINE_DETECTED /* no inline */}

print {\n\n/* final, combined keywords and attributes for an inline function */\n}
print {#define RND_INLINE static RND_INLINE_DETECTED RND_FUNC_UNUSED\n\n}

print {\n\n/* Whether setenv() works */\n}
print_ternary ?libs/env/setenv/presents {#define RND_HAVE_SETENV 1} {/* #undef RND_HAVE_SETENV */}

print {\n\n/* Whether putenv() works */\n}
print_ternary ?libs/env/putenv/presents {#define RND_HAVE_PUTENV 1} {/* #undef RND_HAVE_PUTENV */}

print {\n\n/* Whether usleep() works */\n}
print_ternary ?libs/time/usleep/presents {#define RND_HAVE_USLEEP 1} {/* #undef RND_HAVE_USLEEP */}

print {\n\n/* Whether win32 Sleep() works */\n}
print_ternary ?libs/time/Sleep/presents {#define RND_HAVE_WSLEEP 1} {/* #undef RND_HAVE_WSLEEP */}

print {\n\n/* Whether select() works */\n}
print_ternary ?libs/socket/select/presents {#define RND_HAVE_SELECT 1} {/* #undef RND_HAVE_SELECT */}

print {\n\n/* Define to 1 if you have the `snprintf' function. */\n}
print_ternary ?libs/snprintf {#define RND_HAVE_SNPRINTF 1} {/* #undef RND_HAVE_SNPRINTF */}

print {\n\n/* Define to 1 if you have the `vsnprintf' function. */\n}
print_ternary ?libs/vsnprintf {#define RND_HAVE_VSNPRINTF 1} {/* #undef RND_HAVE_VSNPRINTF */}

print {\n\n/* Define to 1 if you have the `getcwd' function. */\n}
print_ternary ?libs/fs/getcwd/presents {#define RND_HAVE_GETCWD 1} {/* #undef RND_HAVE_GETCWD */}

print {\n\n/* Define to 1 if you have the `_getcwd' function. */\n}
print_ternary ?libs/fs/_getcwd/presents {#define RND_HAVE__GETCWD 1} {/* #undef RND_HAVE__GETCWD */}

print {\n\n/* Define to 1 if you have the `getwd' function. */\n}
print_ternary ?libs/fs/_getwd/presents {#define RND_HAVE_GETWD 1} {/* #undef RND_HAVE_GETWD */}

print {\n\n/* Define to 1 if you have the <gd.h> header file. */\n}
print_ternary ?libs/gui/gd/presents {#define RND_HAVE_GD_H 1} {/* #undef RND_HAVE_GD_H */}

print {\n\n/* Define to 1 if you have the `gdImageGif' function. */\n}
print_ternary ?libs/gui/gd/gdImageGif/presents {#define RND_HAVE_GDIMAGEGIF 1} {/* #undef RND_HAVE_GDIMAGEGIF */}

print {\n\n/* Define to 1 if you have the `gdImageJpeg' function. */\n}
print_ternary ?libs/gui/gd/gdImageJpeg/presents {#define RND_HAVE_GDIMAGEJPEG 1} {/* #undef RND_HAVE_GDIMAGEJPEG */}

print {\n\n/* Define to 1 if you have the `gdImagePng' function. */\n}
print_ternary ?libs/gui/gd/gdImagePng/presents {#define RND_HAVE_GDIMAGEPNG 1} {/* #undef RND_HAVE_GDIMAGEPNG */}

print {\n\n/* Define to 1 if you have the `gdImageSetResolution' function. */\n}
print_ternary ?libs/gui/gd/gdImageSetResolution/presents {#define RND_HAVE_GD_RESOLUTION 1} {/* #undef RND_HAVE_GD_RESOLUTION */}

print {\n\n/* Define to 1 if you have the `getpwuid' function. */\n}
print_ternary ?libs/userpass/getpwuid/presents {#define RND_HAVE_GETPWUID 1} {/* #undef RND_HAVE_GETPWUID */}

print {\n\n/* Define to 1 if you have the `rint' function. */\n}
print_ternary ?libs/math/rint/presents {#define RND_HAVE_RINT 1} {/* #undef RND_HAVE_RINT */}

print {\n\n/* Define to 1 if you have the `round' function. */\n}
print_ternary ?libs/math/round/presents {#define RND_HAVE_ROUND 1} {/* #undef RND_HAVE_ROUND */}

print {\n\n/* Wrapper for S_ISLNK(x); always return 0 if S_ISLNK doesn't exist */\n}
switch ?/target/libs/fs/stat/macros/S_ISLNK
	case {^$} print {#define RND_WRAP_S_ISLNK(x) 0}; end;
	default print [@#define RND_WRAP_S_ISLNK(x) @/target/libs/fs/stat/macros/S_ISLNK@(x)@]; end;
end;

print {\n\n/* Define to 1 if Xinerama is available */\n}
print_ternary ?libs/gui/xinerama/presents {#define RND_HAVE_XINERAMA 1} {/*#undef RND_HAVE_XINERAMA */}

print {\n\n/* Define to 1 if Xrender is available */\n}
print_ternary ?libs/gui/xrender/presents {#define RND_HAVE_XRENDER 1} {/*#undef RND_HAVE_XRENDER */}

print {\n\n/* Define to 1 if we should use windows api for dynamic linking. */\n}
print_ternary ?libs/LoadLibrary/presents {#define RND_USE_LOADLIBRARY 1} {/* #undef RND_USE_LOADLIBRARY */}

print {\n\n/* Define to 1 if we should use mkdtemp for creating temp files. */\n}
print_ternary ?libs/fs/mkdtemp/presents {#define RND_HAVE_MKDTEMP 1} {/* #undef RND_HAVE_MKDTEMP */}

print {\n\n/* Define to 1 if you have the `realpath' function. */\n}
print_ternary ?libs/fs/realpath/presents {#define RND_HAVE_REALPATH 1} {/* #undef RND_HAVE_REALPATH */}

print {\n\n/* Select which mechanism to use for running child processes. */\n}
print_ternary ?/target/libs/proc/wait/presents     {#define RND_USE_FORK_WAIT 1} {/* #undef RND_USE_FORK_WAIT */}
print {\n}
print_ternary ?/target/libs/proc/_spawnvp/presents {#define RND_USE_SPAWNVP 1}   {/* #undef RND_USE_SPAWNVP */}

print {\n\n/* Select which mechanism to use for creating a directory. */\n}
print_ternary ?/target/libs/fs/mkdir/presents     {#define RND_USE_MKDIR 1} {/* #undef RND_USE_MKDIR */}
print {\n}
print_ternary ?/target/libs/fs/_mkdir/presents    {#define RND_USE__MKDIR 1} {/* #undef RND_USE__MKDIR */}
print [@
#define RND_MKDIR_NUM_ARGS 0@?/target/libs/fs/_mkdir/num_args@@?/target/libs/fs/mkdir/num_args@
@]

print {\n\n/* Define whether we have specific signals. */\n}
print_ternary ?signal/names/SIGPIPE/presents    {#define RND_HAVE_SIGPIPE 1} {/* #undef RND_HAVE_SIGPIPE */}
print {\n}
print_ternary ?signal/names/SIGSEGV/presents    {#define RND_HAVE_SIGSEGV 1} {/* #undef RND_HAVE_SIGSEGV */}
print {\n}
print_ternary ?signal/names/SIGABRT/presents    {#define RND_HAVE_SIGABRT 1} {/* #undef RND_HAVE_SIGABRT */}
print {\n}
print_ternary ?signal/names/SIGINT/presents     {#define RND_HAVE_SIGINT 1}  {/* #undef RND_HAVE_SIGINT */}
print {\n}
print_ternary ?signal/names/SIGHUP/presents     {#define RND_HAVE_SIGHUP 1}  {/* #undef RND_HAVE_SIGHUP */}
print {\n}
print_ternary ?signal/names/SIGTERM/presents    {#define RND_HAVE_SIGTERM 1} {/* #undef RND_HAVE_SIGTERM */}
print {\n}
print_ternary ?signal/names/SIGQUIT/presents    {#define RND_HAVE_SIGQUIT 1} {/* #undef RND_HAVE_SIGQUIT */}
print {\n}

print {\n\n/* Whether fungw is system installed */\n}
print_ternary /local/librnd/fungw_system {#define RND_HAVE_SYS_FUNGW 1} {/* #undef RND_HAVE_SYS_FUNGW */}

print {\n/* Code warnings for TODO, portable (unlike #warning) */}
if ?/local/librnd/debug
then
if ?cc/pragma_message
then
print [@
#define DO_PRAGMA(arg) _Pragma(#arg)
#define TODO(x) DO_PRAGMA(message("TODO: " #x))
@]
else
print {\n/* Not available */\n#define TODO(x)\n}
end
else
print {\n/* Not emitted in release */\n#define TODO(x)\n}
end

print {\n\n/* [4.3.1] Define to 1 if you want $PREFIX detected runtime (floating-fhs). */\n}
print_ternary ?/local/librnd/want_floating_fhs {#define RND_WANT_FLOATING_FHS 1} {/* #undef RND_WANT_FLOATING_FHS */}

print [@

/* The host "triplet" - it's really a pair now: machine-os */
#define HOST "@sys/sysid@"

/* Directory separator char */
#define RND_DIR_SEPARATOR_C '@sys/path_sep_escaped@'

/* Directory separator string */
#define RND_DIR_SEPARATOR_S "@sys/path_sep_escaped@"

/* Search path separator string */
#define RND_PATH_DELIMETER ":"

/****************************************************************************/
/* These are static; they are kept "just in case", for further porting */

/* C89 has atexit() */
#define RND_HAS_ATEXIT 1

/* C89 has this */
#define RND_HAVE_UNISTD_H 1

/* Define to 1 if you have the `canonicalize_file_name' function.
   It's a GNU extension, assume we don't have it and fall back to
   realpath() */
/* #define HAVE_CANONICALIZE_FILE_NAME 1 */
/* Define if canonicalize_file_name is not declared in system header files. */
/* #undef NEED_DECLARATION_CANONICALIZE_FILE_NAME */

/* Format: aabbcc where a, b and c are librnd version numbers (major, minor,
   patch). Major must match, minor of the lib should be at least as high as
   the user requires */
#define RND_API_VER @/local/apiver@

/* Format: "aabbcc" or "aabbcc-suffix" where aa, bb and cc are the same as in
   RND_API_VER, optional suffix is an arbitrary string for non-stable-release
   code. */
#define RND_VER_STR "@/local/version@"

@?/local/librnd/include_stdint@

/* Coordinate type and properties, as detected by scconfig */
typedef @/local/librnd/coord_type@ rnd_coord_t;
typedef @/local/librnd/ucoord_type@ rnd_ucoord_t; /* [4.1.0] */
#define RND_COORD_MAX @/local/librnd/coord_max@
#define coord_abs rnd_coord_abs

/* gtk */
#define RND_GTK2_KEY(keyname) (@?libs/gui/gtk2/key_prefix@ ## keyname)


/* ./configure --workaround requests: */
@?/local/librnd/workaround_defs@

/* Make sure to catch usage of non-portable functions in debug mode
   This is in here only because config.h should be included from every source
   file. */
#ifndef NDEBUG
#	undef strdup
#	undef strndup
#	undef snprintf
#	undef round
#	undef strcasecmp
#	define strdup      never_use_strdup__use_rnd_strdup
#	define strndup     never_use_strndup__use_rnd_strndup
#	define snprintf    never_use_snprintf__use_rnd_snprintf
#	define round       never_use_round__use_rnd_round
#	define strcasecmp  never_use_strcasecmp__use_rnd_strcasecmp
#	ifndef RND_SAFE_FS
#		undef fopen
#		undef popen
#		undef system
#		undef remove
#		undef rename
#		define fopen       never_use_fopen__use_rnd_fopen
#		define popen       never_use_popen__use_rnd_popen
#		define system      never_use_system__use_rnd_system
#		define remove      never_use_remove__use_rnd_remove
#		define rename      never_use_rename__use_rnd_rename
#		define mkdir       never_use_mkdir__use_rnd_mkdir
#		define unlink      never_use_unlink__use_rnd_unlink
#		define opendir     never_use_opendir__use_rnd_opendir
#		define readdir     never_use_readdir__use_rnd_readdir
#		define closedir    never_use_closedir__use_rnd_closedir
#		define access      never_use_access__use_rnd_file_readable
#	endif

#endif

#endif
@]
