In the upgrade from tcl/tk 8.3 to 8.4, I started to
encounter trouble compiling programs in Objective-C
that are linked with tcl/tk. We can't compile the
Swarm library (www.swarm.org) against 8.4 because "id"
is used as a variable name. The problem is that
Objective-C uses a reserved word "id" to refer to an
object.
The problems are in tclDecls.h
EXTERN int Tcl_JoinThread _ANSI_ARGS_((Tcl_ThreadId
id, int* result));
I notice in some of your other functions you have
threadId where this one has "id".
As it stands, in order to compile Swarm, I have to
comment out Tcl_JoinThread from tclDecls.h
Logged In: YES
user_id=113501
According to the ANSI standard, compilers are not
supposed to reserve identifiers that do NOT start with
an underscore or double underscore.
Does anybody know if we support compilation using
Objective-C?
Logged In: YES
user_id=23726
Hello. My understanding has been that in C one cannot have
dummy variables named "int", "double", "float", etc. It
won't allow a function like
int aFunct (int double);
or some such thing, right?
In Objective-C, "id' is like "double". The problem would go
away if you just changed "id" to "threadID" in that one method.
Logged In: YES
user_id=202636
Bear in mind that this only requires changing in the public
header. In fact you could simply delete the word 'id' and
leave the bare signature. One wouldn't compile tcl itself
with objective-c but should be able to create extensions
using this compiler.
It certainly used to work (some time ago).