Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Do Windows compilers require WS_VAR_IMPORT in .h files

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Fri, 28 Sep 2012 19:40:29 +0200
Hello Pascal,

On Fri, Sep 28, 2012 at 05:25:41PM +0200, Pascal Quantin wrote:
> 2012/9/28 Joerg Mayer <jmayer@xxxxxxxxx>
> > I'm working on building wireshark with gcc with -fvisibility=hidden. This
> > will mostly mimic the behaviour already on Windows. The gcc attribute
> > to change the visibility causes errors when used in .h files (well, in
> > declarations without a  the object).
> > I have replaced WS_VAR_IMPORT with extern in .h files. Can someone on
> > Windows
> > please test whether this still works?
> 
> it fails with the following errors (MSVC2010EE 32 bits):

Can you please apply the attached patch on top of the previous one to check
whether this fixed the compile problem in packet-dcom.c?
If it does, I will rework the whole patch in the same manner.

Thanks for testing!

 Ciao
    Jörg
-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.
Index: epan/dissectors/packet-dcom.c
===================================================================
--- epan/dissectors/packet-dcom.c	(revision 45191)
+++ epan/dissectors/packet-dcom.c	(working copy)
@@ -470,7 +470,7 @@
 	WIRESHARK_VT_TYPEMASK	     = 0x0fff
 } dcom_vartype_t;
 
-const value_string dcom_variant_type_vals[] = {
+WS_VAL_IMPORT const value_string dcom_variant_type_vals[] = {
 	{ WIRESHARK_VT_EMPTY,		"VT_EMPTY"},
 	{ WIRESHARK_VT_NULL,		"VT_NULL"},
 	{ WIRESHARK_VT_I2,		"VT_I2"},
@@ -519,7 +519,7 @@
 
 
 /* we need an extension mechanism here (be able to append entries by user protocol) */
-const value_string dcom_hresult_vals[] = {
+WS_VAL_IMPORT const value_string dcom_hresult_vals[] = {
 	{ 0x00000000, "S_OK" },
 	{ 0x00000001, "S_FALSE" },
 	{ 0x8000FFFF, "E_UNEXPECTED" },