Check-in [68ce1fca09]
Overview
Comment:Fixed issue when using package versions
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 68ce1fca092ce7b76b6a2054b3ceeeb6bb876674
User & Date: rkeene on 2014-06-18 17:32:38
Other Links: manifest | tags
Context
2014-06-18
18:05
Updated to allow for the possibility of creating a DLL that is not a Tcl package check-in: 24cc34d5f9 user: rkeene tags: trunk
17:32
Fixed issue when using package versions check-in: 68ce1fca09 user: rkeene tags: trunk
17:31
Updated to provide package version numbers check-in: 6ef06b043d user: rkeene tags: trunk
Changes

Modified tcc4tcl.tcl from [127f1d0e84] to [16583ee9af].

    91     91   						append state(code) "  Tcl_CreateObjCommand(interp, \"$procname\", $cname, NULL, NULL);"
    92     92   					}
    93     93   
    94     94   					append state(code) "\}"
    95     95   				}
    96     96   			}
    97     97   			"dll" {
    98         -				append state(code) "int [string totitle $state(package)]_Init(Tcl_Interp *interp) \{\n"
           98  +				set packageName [lindex $state(package) 0]
           99  +				set packageVersion [lindex $state(package) 1]
          100  +				if {$packageVersion == ""} {
          101  +					set packageVersion "0"
          102  +				}
          103  +
          104  +				append state(code) "int [string totitle $packageName]_Init(Tcl_Interp *interp) \{\n"
    99    105   				append state(code) "#ifdef USE_TCL_STUBS\n"
   100    106   				append state(code) "  if (Tcl_InitStubs(interp, \"8.4\" , 0) == 0L) \{\n"
   101    107   				append state(code) "    return TCL_ERROR;\n"
   102    108   				append state(code) "  \}\n"
   103    109   				append state(code) "#endif\n"
   104    110   
   105    111   				if {[info exists state(procs)] && [llength $state(procs)] > 0} {
   106    112   					foreach {procname cname} $state(procs) {
   107    113   						append state(code) "  Tcl_CreateObjCommand(interp, \"$procname\", $cname, NULL, NULL);"
   108    114   					}
   109    115   				}
   110    116   
   111         -				set packageName [lindex $state(package) 0]
   112         -				set packageVersion [lindex $state(package) 1]
   113         -				if {$packageVersion == ""} {
   114         -					set packageVersion "0"
   115         -				}
   116         -
   117    117   				append state(code) "Tcl_PkgProvide(interp, \"$packageName\", \"$packageVersion\");\n"
   118    118   				append state(code) "  return(TCL_OK);\n"
   119    119   				append state(code) "\}"
   120    120   			}
   121    121   		}
   122    122   
   123    123   		# Generate output code