Re: Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic



On Feb 29, 1:25 pm, sbromle <s...@xxxxxxxxxxxxxx> wrote:
On Feb 29, 1:04 pm, Donald G Porter <d...@xxxxxxxx> wrote:



sbromle wrote:
I'm getting a crash moving from Tk8.4 to Tk8.4 on the call
Tk_PhotoSetSize().

I assume that's a typo and you are migrating from Tk 8.4 to Tk 8.5.

See TIP 116 (http://tip.tcl.tk/116) and the Tk 8.5 documentation
for Tk_PhotoSetSize() (http://www.tcl.tk/man/tcl8.5/TkLib/FindPhoto.htm)
for details on how to use the -DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE
directive as a migration tool when compiling your code.

--
| Don Porter Mathematical and Computational Sciences Division |
| donald.por...@xxxxxxxx Information Technology Laboratory |
|http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Thank you kindly Don,

My problem was that I had a -I/usr/include/tcl8.4 line in my AM_CFLAGS
definition left over.

Now I'm faced with another issue. The tcl8.5.m4 macro allows automake
to
define TCL_LIBS, etc, but I don't see where TCL_INCLUDES (or similar)
would
be defined. Is there a way to do that with the standard tcl8.5.m4
autotools
macros? Or must I fully adopt TEA3 (or write my own m4 macro)?

Is there is an easy way to get the -I/usr/include/tcl8.5 in a variable
through the use of --with-tcl=/usr/lib/tcl8.5 flag (used to find
tclConfig.sh)?

The existing tcl8.5.m4 file contains a macro SC_LOAD_TCLCONFIG that
sets TCL_LIB_SPEC but not TCL_INCLUDE_SPEC. Is there a reason why
this is not done? I.e, is it safe / does it make sense/ for me to just
add
a bit to that to also define and AC_SUBST(TCL_INCLUDE_SPEC) ?

Thank you!
Sam


So I've created a very slightly modified version of SC_LOAD_TCLCONFIG
that sets up TCL_INCLUDE_SPEC in addition to TCL_LIB_SPEC, etc.
I put this in my acincludes.m4 and just use that instead. Now my
--with-tcl=/usr/lib/tcl8.5 config argument also sets up the include
directory.

Question: Is this a Bad Thing(TM)? I wonder simply because I can only
assume that most people will just start by using the shipped tcl8.5.m4
file
when compiling extenstions, without looking into TEA. So is there a
reason
why auto-exporting TCL_INCLUDE_SPEC is not done anywhere in tcl8.5.m4?

Below is my modification.
Cheers,
Sam

acinclude.m4:

#------------------------------------------------------------------------
# SC_LOAD_TCLCONFIG_WITH_INCLUDES --
#
# Like the standard SCL_LOAD_TCLCONFIG, that is:
# Load the tclConfig.sh file
# but in addition, set the TCL_INCLUDE_SPEC attribute as well.
#
# Arguments:
#
# Requires the following vars to be set:
# TCL_BIN_DIR
#
# Results:
#
# Subst the following vars:
# TCL_BIN_DIR
# TCL_SRC_DIR
# TCL_LIB_FILE
#
# and
#
# TCL_INCLUDE_SPEC
#
#------------------------------------------------------------------------

AC_DEFUN([SC_LOAD_TCLCONFIG_WITH_INCLUDES], [
AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])

if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
AC_MSG_RESULT([loading])
. "${TCL_BIN_DIR}/tclConfig.sh"
else
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi

# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""

# If the TCL_BIN_DIR is the build directory (not the install
directory),
# then set the common variable name to the value of the build
variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
# of TCL_BUILD_LIB_SPEC. An extension should make use of
TCL_LIB_SPEC
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
# installed and uninstalled version of Tcl.
if test -f "${TCL_BIN_DIR}/Makefile" ; then
TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
elif test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
# against Tcl.framework installed in an arbitary location.
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
for i in "`cd ${TCL_BIN_DIR}; pwd`" \
"`cd ${TCL_BIN_DIR}/../..; pwd`"; do
if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
break
fi
done
fi
if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
fi
;;
esac
fi

# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\""
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""

AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)

AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_FLAG)
AC_SUBST(TCL_LIB_SPEC)

AC_SUBST(TCL_INCLUDE_SPEC)

AC_SUBST(TCL_STUB_LIB_FILE)
AC_SUBST(TCL_STUB_LIB_FLAG)
AC_SUBST(TCL_STUB_LIB_SPEC)
])

.



Relevant Pages

  • Trying to get screamer working
    ... ; Byte Compiling Top-Level Form: ... from a nondeterministic context. ... function defined with DEFUN, the body of a call to the FOR-EFFECTS ... macro, the first argument of a call to the ONE-VALUE macro, the body of ...
    (comp.lang.lisp)
  • Re: Behaviors between Macros 2 Times
    ... > (defmacro test (x y z) ... > `(format t "this line is in vain because it is not retured by macro ... > this is compiling time ... > It means that the "macro machine" thinkns that the variables were ...
    (comp.lang.lisp)
  • Re: Protected cells
    ... I don't understand about the not compiling if you recorded in xl2003. ... Dim myAllowEditRange As AllowEditRange ... In the macro I'm currently using is there a way ... what I meant is that I want to remove the users ability to edit the ...
    (microsoft.public.excel.misc)
  • Re: Migrating COM dll from ATL3 to ATL7
    ... > I have a COM dll originally developed using VC++ 6 now ... > compiling under VC++ .NET. ... The common way is to write a registration script (.rgs file), ... DECLARE_REGISTRY_RESOURCEID macro. ...
    (microsoft.public.vc.atl)
  • Re: help win MPITB under windows
    ... some error occurred while compiling the MPI_Bcast.c, ... FUNCALL MPI_Bcast; ... Errors seems coming from the macro BCNTYPE_DECL and BCNTYPE_GET ... of C/C++? ...
    (comp.soft-sys.matlab)