Bochs/bochs-testing/plugin-test/test4-interdep
Bryce Denney 7f9c1489df - make it compile on non-win32 platforms by stuffing all the DLL details
into macros.  I got the idea for the MODULE1API(type) macros from
  expat.h that happens to be sitting on my disk.
- modified:
    test2-dynamic/module1.cc test2-dynamic/module1.h
    test3-twomodules/module1.cc test3-twomodules/module1.h
    test3-twomodules/module2.cc test3-twomodules/module2.h
    test4-interdep/module1.cc test4-interdep/module1.h
    test4-interdep/module2.cc test4-interdep/module2.h
2002-10-11 15:29:32 +00:00
..
Makefile - in bochs-testing area, check in shared library tests that I wrote while 2002-10-11 14:51:27 +00:00
module1.cc - make it compile on non-win32 platforms by stuffing all the DLL details 2002-10-11 15:29:32 +00:00
module1.h - make it compile on non-win32 platforms by stuffing all the DLL details 2002-10-11 15:29:32 +00:00
module2.cc - make it compile on non-win32 platforms by stuffing all the DLL details 2002-10-11 15:29:32 +00:00
module2.h - make it compile on non-win32 platforms by stuffing all the DLL details 2002-10-11 15:29:32 +00:00
README - in bochs-testing area, check in shared library tests that I wrote while 2002-10-11 14:51:27 +00:00
uselib.cc - in bochs-testing area, check in shared library tests that I wrote while 2002-10-11 14:51:27 +00:00
uselib.h - in bochs-testing area, check in shared library tests that I wrote while 2002-10-11 14:51:27 +00:00

test4-interdep

Can one module reference objects in another module? Yes.

module1 exports module_name and operate(int,int).
module2 exports n_operations and operation_occurred().

uselib.cc uses symbols and functions from both modules.
Module1 calls operation_occurred() in module2.

To do this, module2 must be built first.  Then module1 is linked
against module2 so that the missing symbols are available.  Then,
uselib is linked against both.

This shows that we can chain libraries.  I haven't seen any way to
resolve a circular dependency, where mod1 depends on mod2 and vice 
versa, in win32 DLLs.  Probably those are not supported.