Diff

Differences From Artifact [bab566bd8a]:

To Artifact [3729076ea4]:


    32     32   #endif /* MB_TASKMODAL */
    33     33   
    34     34   #include "tclInt.h"
    35     35   
    36     36   #ifdef HAVE_UNISTD_H
    37     37   #  include <unistd.h>
    38     38   #endif
    39         -#ifdef HAVE_DLADDR
    40         -#  ifdef HAVE_DLFCN_H
    41         -#    include <dlfcn.h>
    42         -#  else
    43         -#    undef HAVE_DLADDR
    44         -#  endif
           39  +
           40  +/* For dladdr() and Dl_info */
           41  +#ifdef HAVE_DLFCN_H
           42  +#  include <dlfcn.h>
    45     43   #endif
    46     44   
    47     45   #if defined(HAVE_TCL_GETENCODINGNAMEFROMENVIRONMENT) && defined(HAVE_TCL_SETSYSTEMENCODING)
    48     46   #  define TCLKIT_CAN_SET_ENCODING 1
    49     47   #endif
    50     48   #if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
    51     49   #  define TCLKIT_REQUIRE_TCLEXECUTABLENAME 1
................................................................................
   208    206   	Tcl_Obj *lobjv[1];
   209    207   #ifdef HAVE_READLINK
   210    208   	ssize_t readlink_ret;
   211    209   	char procpath[4096];
   212    210   	char exe_buf[4096];
   213    211   	int snprintf_ret;
   214    212   #endif /* HAVE_READLINK */
   215         -#ifdef HAVE_DLADDR
          213  +#ifdef HAVE_ACCEPTABLE_DLADDR
   216    214   	Dl_info syminfo;
   217    215   	int dladdr_ret;
   218         -#endif /* HAVE_DLADDR */
          216  +#endif /*aHAVE_ACCEPTABLE_DLADDR */ 
   219    217   
   220    218   #ifdef HAVE_READLINK
   221    219   	if (Tcl_GetNameOfExecutable() == NULL) {
   222    220   		snprintf_ret = snprintf(procpath, sizeof(procpath), "/proc/%lu/exe", (unsigned long) getpid());
   223    221   		if (snprintf_ret < sizeof(procpath)) {
   224    222   			readlink_ret = readlink(procpath, exe_buf, sizeof(exe_buf) - 1);
   225    223   
................................................................................
   230    228   
   231    229   				return;
   232    230   			}
   233    231   		}
   234    232   	}
   235    233   #endif /* HAVE_READLINK */
   236    234   
   237         -#ifdef HAVE_DLADDR
          235  +#ifdef HAVE_ACCEPTABLE_DLADDR
   238    236   	if (Tcl_GetNameOfExecutable() == NULL) {
   239    237   		dladdr_ret = dladdr(&SetExecName, &syminfo);
   240    238   		if (dladdr_ret != 0) {
   241    239   			SetExecName(interp, syminfo.dli_fname);
   242    240   		}
   243    241   	}
   244         -#endif /* HAVE_DLADDR */
          242  +#endif /* HAVE_ACCEPTABLE_DLADDR */
   245    243   
   246    244   	if (Tcl_GetNameOfExecutable() == NULL) {
   247    245   		lobjv[0] = Tcl_GetVar2Ex(interp, "argv0", NULL, TCL_GLOBAL_ONLY);
   248    246   		execNameObj = Tcl_FSJoinToPath(Tcl_FSGetCwd(interp), 1, lobjv);
   249    247   
   250    248   		SetExecName(interp, Tcl_GetStringFromObj(execNameObj, &len));
   251    249