WS_DLL_PUBLIC is now always WS_DLL_PUBLIC_NOEXTERN with "extern" added;
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 3 Jul 2013 01:43:39 +0000 (01:43 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 3 Jul 2013 01:43:39 +0000 (01:43 +0000)
just define WS_DLL_PUBLIC_NOEXTERN inside the ifdefs, and define
WS_DLL_PUBLIC as WS_DLL_PUBLIC_NOEXTERN followed by "extern".

Then rename WS_DLL_PUBLIC_NOEXTERN to WS_DLL_PUBLIC_DEF, to clarify that
it's what should be used for definitions; at least on Windows, you
*have* to use it when declaring arrays without a size, and, whilst you
might be able to use WS_DLL_PUBLIC for definitions of functions and
perhaps data definitions other than no-size arrays, it might be clearer
to rename WS_DLL_PUBLIC to WS_DLL_PUBLIC_DECL and use it only for
declarations.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@50334 f5534014-38df-0310-8fa8-9805f1628bb7

doc/README.plugins
doc/README.stats_tree
docbook/wsdg_src/WSDG_chapter_dissection.xml
epan/follow.c
plugins/easy_codec/easy_codec_plugin.c
plugins/stats_tree/stats_tree_plugin.c
plugins/tpg/packet-http.c
tools/make-dissector-reg
tools/make-dissector-reg.py
tools/wireshark_gen.py
ws_symbol_export.h

index e60179d9e8aceb53796fdc2081a85707f41fb862..3635629058bf40561af7cb627d566aac8e4a98eb 100644 (file)
@@ -287,7 +287,7 @@ stips the parts outlined below:
     o Removed the definition:
 
         #ifndef ENABLE_STATIC
-        WS_DLL_PUBLIC_NOEXTERN gchar version[] = VERSION;
+        WS_DLL_PUBLIC_DEF gchar version[] = VERSION;
         #endif
 
     o Move relevant code from the blocks and delete these functions:
index f20c6425895ec5c8db11afe23ef5bf2071e180ce..91090e0df2426b2a71d3250a7261f31ab4e7e529 100644 (file)
@@ -110,9 +110,9 @@ extern int udp_term_stats_tree_packet(stats_tree *st, /* st as it was passed to
 }
 
 #ifndef ENABLE_STATIC
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = "0.0";
+WS_DLL_PUBLIC_DEF const gchar version[] = "0.0";
 
-WS_DLL_PUBLIC_NOEXTERN void plugin_register_tap_listener(void) {
+WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void) {
 
     stats_tree_register("udp", /* the proto we are going to "tap" */
                         "udp_terms", /* the abbreviation for this tree (to be used as -z udp_terms,tree) */
index efdda7829b6e6df754232cf05c2db1953db62146..40b73bc537fd230a5541a04f2138b37af1d7bd9a 100644 (file)
@@ -1115,9 +1115,9 @@ static void register_foo_stat_trees(void) {
         foo_stats_tree_packet, foo_stats_tree_init, NULL);
 }
 
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = "0.0";
+WS_DLL_PUBLIC_DEF const gchar version[] = "0.0";
 
-WS_DLL_PUBLIC_NOEXTERN void plugin_register_tap_listener(void)
+WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void)
 {
     register_foo_stat_trees();
 }
index 0765201bb30fc8cef8f91850e89901b358f13ec4..f4b156ce48c80a2792992971a93405929f99e621 100644 (file)
@@ -50,7 +50,7 @@ typedef struct _tcp_frag {
   struct _tcp_frag   *next;
 } tcp_frag;
 
-WS_DLL_PUBLIC_NOEXTERN
+WS_DLL_PUBLIC_DEF
 FILE* data_out_file = NULL;
 
 gboolean empty_tcp_stream;
index ac21f41da016073c7a9500265e5614702b6d7370..2e586787ce2f8a598408528d9fb1b5cb8b4bc2a2 100644 (file)
@@ -37,9 +37,9 @@
 #include "codec-g729a.h"
 #include "codec-g722.h"
 
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = "0.0.1";
+WS_DLL_PUBLIC_DEF const gchar version[] = "0.0.1";
 
-WS_DLL_PUBLIC_NOEXTERN void register_codec_module(void)
+WS_DLL_PUBLIC_DEF void register_codec_module(void)
 {
   register_codec("g723", codec_g7231_init, codec_g7231_release, codec_g7231_decode);
   register_codec("g729", codec_g729a_init, codec_g729a_release, codec_g729a_decode);
index ff178193566176f4b17515649fbca7f24efd7d12..b25e8f91a96572474923048afd362c2f0e221a2e 100644 (file)
@@ -36,9 +36,9 @@
 
 #include "pinfo_stats_tree.h"
 
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = "0.0.1";
+WS_DLL_PUBLIC_DEF const gchar version[] = "0.0.1";
 
-WS_DLL_PUBLIC_NOEXTERN void plugin_register_tap_listener(void)
+WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void)
 {
        register_pinfo_stat_trees();
 }
index 841d453761df1a99ef0d0ee1ed61aff23037819e..b15219892dc0037c80f4600fac77f8673b225b17 100644 (file)
@@ -122,9 +122,9 @@ static void proto_reg_handoff_http(void) {
 
 #ifndef ENABLE_STATIC
 
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = "0.0.0";
+WS_DLL_PUBLIC_DEF const gchar version[] = "0.0.0";
 
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_register(void)
 {
     /* register the new protocol, protocol fields, and subtrees */
@@ -133,7 +133,7 @@ plugin_register(void)
     }
 }
 
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_reg_handoff(void){
     proto_reg_handoff_http();
 }
index a4552884cff99abee61c0b7e85be16e931571799..6233561c4af121868d0afe7561a5d97e800efdf6 100755 (executable)
@@ -47,11 +47,11 @@ then
 #include "ws_symbol_export.h"
 
 #ifndef ENABLE_STATIC
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = VERSION;
+WS_DLL_PUBLIC_DEF const gchar version[] = VERSION;
 
 /* Start the functions we need for the plugin stuff */
 
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_register (void)
 {
 EOF
@@ -119,7 +119,7 @@ echo '}' >>${outfile}-tmp
 if [ "$registertype" = plugin ]
 then
        cat <<"EOF" >>${outfile}-tmp
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_reg_handoff(void)
 {
 EOF
index 8e1134d19e4aadbf730eeebd7c2069fa7181cd6d..150097204a4f6f2420f6567077446d097c4dc4a5 100755 (executable)
@@ -195,11 +195,11 @@ if registertype == "plugin" or registertype == "plugin_wtap":
 #include "ws_symbol_export.h"
 
 #ifndef ENABLE_STATIC
-WS_DLL_PUBLIC_NOEXTERN const gchar version[] = VERSION;
+WS_DLL_PUBLIC_DEF const gchar version[] = VERSION;
 
 /* Start the functions we need for the plugin stuff */
 
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_register (void)
 {
 """
@@ -223,7 +223,7 @@ reg_code += "}\n"
 # Make the routine to register all protocol handoffs
 if registertype == "plugin" or registertype == "plugin_wtap":
        reg_code += """
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_reg_handoff(void)
 {
 """
@@ -246,7 +246,7 @@ if registertype == "plugin":
        reg_code += "#endif\n"
 elif registertype == "plugin_wtap":
        reg_code += """
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 register_wtap_module(void)
 {
 """
index def0b302147902f9d0d1b3e90dc0c82908e4f65f..41048415d8199960aac1b553318dc1c787d3e298 100755 (executable)
@@ -1976,7 +1976,7 @@ static guint32  boundary = GIOP_HEADER_SIZE;  /* initial value */"""
     template_plugin_register = """
 #if 0
 
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_register(void)
 {
    if (proto_@dissector_name@ == -1) {
@@ -1984,7 +1984,7 @@ plugin_register(void)
    }
 }
 
-WS_DLL_PUBLIC_NOEXTERN void
+WS_DLL_PUBLIC_DEF void
 plugin_reg_handoff(void){
    proto_register_handoff_giop_@dissector_name@();
 }
index e2c0e6f2fa6f9aadb32759410cb7b3b70cfab585..5654ad1243026950a168e65deddc2f2f86e5f45d 100644 (file)
@@ -34,8 +34,8 @@
 #undef WS_DLL_PUBLIC
 #endif
 
-#ifdef WS_DLL_PUBLIC_NOEXTERN
-#undef WS_DLL_PUBLIC_NOEXTERN
+#ifdef WS_DLL_PUBLIC_DEF
+#undef WS_DLL_PUBLIC_DEF
 #endif
 
 #ifdef WS_DLL_LOCAL
@@ -52,7 +52,7 @@
   /* Compiling for Windows, so we use the Windows DLL declarations. */
   #ifdef WS_BUILD_DLL
     /*
-     * Building a library; for all definitions, we want dllexport, and
+     * Building a DLL; for all definitions, we want dllexport, and
      * (presumably so source from DLL and source from a program using the
      * DLL can both include a header that declares APIs and exported data
      * for the DLL), for declarations, either dllexport or dllimport will
      */
     #ifdef __GNUC__
       /* GCC */
-#define WS_DLL_PUBLIC __attribute__ ((dllexport)) extern
-#define WS_DLL_PUBLIC_NOEXTERN __attribute__ ((dllexport))
+#define WS_DLL_PUBLIC_DEF __attribute__ ((dllexport))
     #else /* ! __GNUC__ */
       /*
        * Presumably MSVC.
        * Note: actually gcc seems to also support this syntax.
        */
-#define WS_DLL_PUBLIC __declspec(dllexport) extern
-#define WS_DLL_PUBLIC_NOEXTERN __declspec(dllexport)
+#define WS_DLL_PUBLIC_DEF __declspec(dllexport)
     #endif /* __GNUC__ */
   #else /* WS_BUILD_DLL */
     /*
      */
     #ifdef __GNUC__
       /* GCC */
-#define WS_DLL_PUBLIC __attribute__ ((dllimport)) extern
-#define WS_DLL_PUBLIC_NOEXTERN __attribute__ ((dllimport))
+#define WS_DLL_PUBLIC_DEF __attribute__ ((dllimport))
     #elif ! (defined ENABLE_STATIC) /* ! __GNUC__ */
       /*
        * Presumably MSVC.
        * Note: actually gcc seems to also support this syntax.
        */
-#define WS_DLL_PUBLIC __declspec(dllimport) extern
-#define WS_DLL_PUBLIC_NOEXTERN __declspec(dllimport)
+#define WS_DLL_PUBLIC_DEF __declspec(dllimport)
     #else /* ! __GNUC__  && ENABLE_STATIC */
       /* presumably MSVC */
-#define WS_DLL_PUBLIC extern
-#define WS_DLL_PUBLIC_NOEXTERN
+#define WS_DLL_PUBLIC_DEF
     #endif /* __GNUC__ */
   #endif /* WS_BUILD_DLL */
   #define WS_DLL_LOCAL
    * with GCC 4 or later.
    */
   #if __GNUC__ >= 4
-#define WS_DLL_PUBLIC __attribute__ ((visibility ("default"))) extern
-#define WS_DLL_PUBLIC_NOEXTERN __attribute__ ((visibility ("default")))
+#define WS_DLL_PUBLIC_DEF __attribute__ ((visibility ("default")))
 #define WS_DLL_LOCAL  __attribute__ ((visibility ("hidden")))
   #else /* ! __GNUC__ >= 4 */
-    #define WS_DLL_PUBLIC extern
-    #define WS_DLL_PUBLIC_NOEXTERN
+    #define WS_DLL_PUBLIC_DEF
     #define WS_DLL_LOCAL
   #endif /* __GNUC__ >= 4 */
 #endif
 
+/*
+ * Use this for declarations; it can also be used for exported
+ * *function* definitions, but must not be used for exported *data*
+ * definitions.
+ */
+#define WS_DLL_PUBLIC  WS_DLL_PUBLIC_DEF extern
+
 #endif /* SYMBOL_EXPORT_H */