summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2003-07-10 09:18:02 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2003-07-10 09:18:02 +0000
commite17948edf5e19dab31eca90af25337e37aee8eb2 (patch)
treee793482fb336e6b11dfbb2ae9f532f186f89dbbe
parent3577d2c1fa3faa196a80e4867ab099f0fe6f3318 (diff)
Encore un effort sur le probleme de camltk.h et des DLLs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5681 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--otherlibs/labltk/support/Makefile.nt2
-rw-r--r--otherlibs/labltk/support/camltk.h11
-rw-r--r--otherlibs/labltk/support/cltkEval.c5
-rw-r--r--otherlibs/labltk/tkanim/cltkaniminit.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/otherlibs/labltk/support/Makefile.nt b/otherlibs/labltk/support/Makefile.nt
index 0bb6535d1..e1720efb4 100644
--- a/otherlibs/labltk/support/Makefile.nt
+++ b/otherlibs/labltk/support/Makefile.nt
@@ -13,7 +13,7 @@ COBJS=cltkCaml.o cltkUtf.o cltkEval.o cltkEvent.o cltkFile.o \
DCOBJS=$(COBJS:.o=.$(DO))
SCOBJS=$(COBJS:.o=.$(SO))
-CCFLAGS=-I../../../byterun -I../../win32unix $(TK_DEFS)
+CCFLAGS=-I../../../byterun -I../../win32unix $(TK_DEFS) -DIN_CAMLTKSUPPORT
COMPFLAGS=-I $(OTHERS)/win32unix
diff --git a/otherlibs/labltk/support/camltk.h b/otherlibs/labltk/support/camltk.h
index 44354076a..deba33086 100644
--- a/otherlibs/labltk/support/camltk.h
+++ b/otherlibs/labltk/support/camltk.h
@@ -16,6 +16,12 @@
/* $Id$ */
+#if defined(_WIN32) && defined(CAML_DLL) && defined(IN_CAMLTKSUPPORT)
+#define CAMLTKextern CAMLexport
+#else
+#define CAMLTKextern CAMLextern
+#endif
+
/* cltkMisc.c */
/* copy a Caml string to the C heap. Must be deallocated with stat_free */
extern char *string_to_c(value s);
@@ -25,8 +31,7 @@ extern value tcl_string_to_caml( char * );
extern char * caml_string_to_tcl( value );
/* cltkEval.c */
-extern Tcl_Interp *cltclinterp; /* The Tcl interpretor */
-extern Tcl_Interp * get_cltclinterp(void);
+CAMLTKextern Tcl_Interp *cltclinterp; /* The Tcl interpretor */
extern value copy_string_list(int argc, char ** argv);
/* cltkCaml.c */
@@ -35,7 +40,7 @@ extern value *tkerror_exn;
extern value *handler_code;
extern int CamlCBCmd(ClientData clientdata, Tcl_Interp *interp,
int argc, char *argv[]);
-extern void tk_error(char * errmsg) Noreturn;
+CAMLTKextern void tk_error(char * errmsg) Noreturn;
/* cltkMain.c */
extern int signal_events;
diff --git a/otherlibs/labltk/support/cltkEval.c b/otherlibs/labltk/support/cltkEval.c
index 5c9aeac12..b31bc1adf 100644
--- a/otherlibs/labltk/support/cltkEval.c
+++ b/otherlibs/labltk/support/cltkEval.c
@@ -32,11 +32,6 @@
/* The Tcl interpretor */
Tcl_Interp *cltclinterp = NULL;
-CAMLexport Tcl_Interp * get_cltclinterp(void)
-{
- return cltclinterp;
-}
-
/* Copy a list of strings from the C heap to Caml */
value copy_string_list(int argc, char **argv)
{
diff --git a/otherlibs/labltk/tkanim/cltkaniminit.c b/otherlibs/labltk/tkanim/cltkaniminit.c
index 1839bbf80..a45bedcb5 100644
--- a/otherlibs/labltk/tkanim/cltkaniminit.c
+++ b/otherlibs/labltk/tkanim/cltkaniminit.c
@@ -22,7 +22,7 @@ extern int Tkanim_Init(Tcl_Interp *);
CAMLprim value tkanim_init (rien) /* ML */
value rien;
{
- if (Tkanim_Init(get_cltclinterp()) != TCL_OK)
+ if (Tkanim_Init(cltclinterp) != TCL_OK)
tk_error ("Can't initialize TkAnim");
return Val_unit;
}