Ethereal-dev: Re: [Ethereal-dev] Was packet-rtnet fixed and I missed it?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Lars Roland <lars.roland@xxxxxxx>
Date: Wed, 01 Dec 2004 16:50:03 +0100
Guy Harris schrieb:
Lars Roland wrote:

What should happen to "flags_set_truth"? IMO we should remove it from "libethereal.def". The way it is used in dissectors (initializing static variables, e.g hf_register_info arrays) we can't use it in plugins on Win32.


I.e., unlike the way most (all?) UNIX shared library mechanisms work, with the data being linked statically and the code being linked dynamically, so that the data is at a fixed address, allowing pointers to be used as initializers for static variables, the Windows shared library mechanism links the data dynamically, so that the address isn't known until run time, and the run-time linker doesn't patch up the data at run time?

May be.
I have observed that just adding the keyword __declspec(dllimport) to tell the linker that flags_set_truth comes from another dll immediately leads to compiler error C2099: "initializer is not a constant", although the declaration of flags_set_truth is constified. Either the MSVC compiler isn't smart enough and just wants to resolve initial values at compile time or your scenario applies.