[cmake-commits] king committed example_exe.cxx 1.2 1.3 example_mod_1.c 1.1 1.2

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Apr 19 11:32:46 EDT 2007


Update of /cvsroot/CMake/CMake/Tests/Plugin/src
In directory public:/mounts/ram/cvs-serv24521/Tests/Plugin/src

Modified Files:
	example_exe.cxx example_mod_1.c 
Log Message:
ENH: Added function call argument to module function to make sure calling convention matches on lookup.  Fixed for Watcom.


Index: example_mod_1.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Plugin/src/example_mod_1.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- example_mod_1.c	17 Apr 2007 17:43:03 -0000	1.1
+++ example_mod_1.c	19 Apr 2007 15:32:43 -0000	1.2
@@ -8,9 +8,15 @@
 # define MODULE_EXPORT
 #endif
 
-MODULE_EXPORT int example_mod_1_function()
+#ifdef __WATCOMC__
+# define MODULE_CCONV __cdecl
+#else
+# define MODULE_CCONV
+#endif
+
+MODULE_EXPORT int MODULE_CCONV example_mod_1_function(int n)
 {
-  int result = example_exe_function() + 456;
+  int result = example_exe_function() + n;
   printf("world\n");
   return result;
 }

Index: example_exe.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Plugin/src/example_exe.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- example_exe.cxx	17 Apr 2007 17:52:50 -0000	1.2
+++ example_exe.cxx	19 Apr 2007 15:32:43 -0000	1.3
@@ -44,8 +44,12 @@
       << kwsys_ios::endl;
     return 1;
     }
-  int(*f)() = reinterpret_cast<int(*)()>(sym);
-  if(f() != (123+456))
+#ifdef __WATCOMC__
+  int(__cdecl *f)(int) = (int(__cdecl *)(int))(sym);
+#else
+  int(*f)(int) = reinterpret_cast<int(*)(int)>(sym);
+#endif
+  if(f(456) != (123+456))
     {
     kwsys_ios::cerr << "Incorrect return value from plugin!"
                     << kwsys_ios::endl;



More information about the Cmake-commits mailing list