#! /bin/sh
##############################################################################
-# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. #
+# Copyright 2019-2020,2021 Thomas E. Dickey #
+# Copyright 1998-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
#
# Author: Thomas E. Dickey, 1997-on
#
-# $Id: MKexpanded.sh,v 1.15 2009/06/27 20:37:50 tom Exp $
+# $Id: MKexpanded.sh,v 1.23 2021/06/17 21:26:02 tom Exp $
#
# Script to generate 'expanded.c', a dummy source that contains functions
# corresponding to complex macros used in this library. By making functions,
fi
TMP=gen$$.c
-trap "rm -f $TMP" 0 1 2 5 15
+trap "rm -f $TMP" EXIT INT QUIT TERM HUP
cat <<EOF
/* generated by MKexpanded.sh */
#define NEED_NCURSES_CH_T 1
#include <curses.priv.h>
-#include <term.h>
+
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
#if NCURSES_EXPANDED
EOF
}
NCURSES_EXPORT(void)
-_nc_toggle_attr_off (attr_t *S, attr_t at)
+_nc_toggle_attr_off (attr_t *S, attr_t at)
{
toggle_attr_off(*S,at);
}
EOF
$preprocessor $TMP 2>/dev/null | \
- sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#if_/#if /'
+ sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#[ ]*if_/#if /' -e "s,$TMP,expanded.c,"
cat <<EOF
#else /* ! NCURSES_EXPANDED */