]> git.saurik.com Git - wxWidgets.git/commitdiff
1. DLL compilation fixes (wrong WXDLLEXPORT placement) in db.h/cpp
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 12 Oct 1999 23:57:40 +0000 (23:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 12 Oct 1999 23:57:40 +0000 (23:57 +0000)
2. dummy typedef added to gsocket.c - trans unit can't be empty
3. WX_DEFINE_EXPORTED_ARRAY & friends appear

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/db.h
include/wx/dynarray.h
include/wx/msw/dcclient.h
include/wx/msw/listbox.h
include/wx/msw/notebook.h
include/wx/msw/treectrl.h
include/wx/textfile.h
src/common/db.cpp
src/common/mimetype.cpp
src/msw/gsocket.c

index 90f70ffa35968f22c3ebfc40640c6c6e16c1086d..c624086c265f5f26356fb374a851c322f47b9604 100644 (file)
@@ -443,7 +443,7 @@ class CstructTablesInUse : public wxObject
 // for other code segments to use, or close all of them when the application has
 // completed.
 
-wxDB* WXDLLEXPORT GetDbConnection(DbStuff *pDbStuff);
+wxDB WXDLLEXPORT *GetDbConnection(DbStuff *pDbStuff);
 bool  WXDLLEXPORT FreeDbConnection(wxDB *pDb);
 void  WXDLLEXPORT CloseDbConnections(void);
 int   WXDLLEXPORT NumberDbConnectionsInUse(void);
index 8e69a43ee230a1a9ed347bf8627cdf9b60d2aa23..a3c4017ada52beba2b7d6caa86a49fa6394d8beb 100644 (file)
@@ -165,9 +165,9 @@ private:
 //    { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src);
 // so using a temporary variable instead.
 // ----------------------------------------------------------------------------
-#define  _WX_DEFINE_ARRAY(T, name)                                  \
+#define  _WX_DEFINE_ARRAY(T, name, classexp)                        \
 typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2);       \
-class WXDLLEXPORT name : public wxBaseArray                         \
+classexp name : public wxBaseArray                                  \
 {                                                                   \
 public:                                                             \
   name()                                                            \
@@ -228,9 +228,9 @@ public:                                                             \
 //    { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src);
 // so using a temporary variable instead.
 // ----------------------------------------------------------------------------
-#define  _WX_DEFINE_SORTED_ARRAY(T, name)                           \
+#define  _WX_DEFINE_SORTED_ARRAY(T, name, classexp)                 \
 typedef int (CMPFUNC_CONV *SCMPFUNC##T)(T pItem1, T pItem2);        \
-class WXDLLEXPORT name : public wxBaseArray                         \
+classexp name : public wxBaseArray                                  \
 {                                                                   \
 public:                                                             \
   name(SCMPFUNC##T fn)                                              \
@@ -274,9 +274,9 @@ private:                                                            \
 // ----------------------------------------------------------------------------
 // see WX_DECLARE_OBJARRAY and WX_DEFINE_OBJARRAY
 // ----------------------------------------------------------------------------
-#define _WX_DECLARE_OBJARRAY(T, name)                               \
+#define _WX_DECLARE_OBJARRAY(T, name, classexp)                     \
 typedef int (CMPFUNC_CONV *CMPFUNC##T)(T** pItem1, T** pItem2);     \
-class WXDLLEXPORT name : public wxBaseArray                         \
+classexp name : public wxBaseArray                                  \
 {                                                                   \
 public:                                                             \
   name() { }                                                        \
@@ -340,15 +340,17 @@ private:                                                            \
 
    @memo declare and define array class 'name' containing elements of type 'T'
   */
-#define WX_DEFINE_ARRAY(T, name)  typedef T _A##name;                        \
-                                  _WX_DEFINE_ARRAY(_A##name, name)
+#define WX_DEFINE_ARRAY(T, name)                \
+    typedef T _A##name;                         \
+    _WX_DEFINE_ARRAY(_A##name, name, class)
 
   /**
    This macro does the same as WX_DEFINE_ARRAY except that the array will be
    sorted with the specified compare function.
    */
-#define WX_DEFINE_SORTED_ARRAY(T, name)  typedef T _A##name;                 \
-                                  _WX_DEFINE_SORTED_ARRAY(_A##name, name)
+#define WX_DEFINE_SORTED_ARRAY(T, name)             \
+    typedef T _A##name;                             \
+    _WX_DEFINE_SORTED_ARRAY(_A##name, name, class)
 
   /**
    This macro generates a new objarrays class which owns the objects it
@@ -385,8 +387,10 @@ private:                                                            \
 
    @memo declare objarray class 'name' containing elements of type 'T'
   */
-#define WX_DECLARE_OBJARRAY(T, name)  typedef T _L##name;                 \
-                                      _WX_DECLARE_OBJARRAY(_L##name, name)
+#define WX_DECLARE_OBJARRAY(T, name)            \
+    typedef T _L##name;                         \
+    _WX_DECLARE_OBJARRAY(_L##name, name, class)
+
   /**
     To use an objarray class you must
     <ll>
@@ -407,18 +411,32 @@ private:                                                            \
 #define WX_DEFINE_OBJARRAY(name)       "don't forget to include arrimpl.cpp!"
 //@}
 
+// these macros do the same thing as the WX_XXX ones above, but should be used
+// inside the library for user visible classes because otherwise they wouldn't
+// be visible from outside (when using wxWindows as DLL under Windows)
+#define WX_DEFINE_EXPORTED_ARRAY(T, name)               \
+    typedef T _A##name;                                 \
+    _WX_DEFINE_ARRAY(_A##name, name, class WXDLLEXPORT)
+
+#define WX_DEFINE_SORTED_EXPORTED_ARRAY(T, name)        \
+    typedef T _A##name;                                 \
+    _WX_DEFINE_SORTED_ARRAY(_A##name, name, class WXDLLEXPORT)
+
+#define WX_DECLARE_EXPORTED_OBJARRAY(T, name)           \
+    typedef T _L##name;                                 \
+    _WX_DECLARE_OBJARRAY(_L##name, name, class WXDLLEXPORT)
+
 // ----------------------------------------------------------------------------
 /** @name Some commonly used predefined arrays */
-// # overhead if not used?
 // ----------------------------------------------------------------------------
 
 //@{
   /** @name ArrayInt */
-WX_DEFINE_ARRAY(int,    wxArrayInt);
+WX_DEFINE_EXPORTED_ARRAY(int, wxArrayInt);
   /** @name ArrayLong */
-WX_DEFINE_ARRAY(long,   wxArrayLong);
+WX_DEFINE_EXPORTED_ARRAY(long, wxArrayLong);
   /** @name ArrayPtrVoid */
-WX_DEFINE_ARRAY(void *, wxArrayPtrVoid);
+WX_DEFINE_EXPORTED_ARRAY(void *, wxArrayPtrVoid);
 //@}
 
 //@}
@@ -443,5 +461,6 @@ WX_DEFINE_ARRAY(void *, wxArrayPtrVoid);
                                                                               \
         array.Empty();                                                        \
     }
+
 #endif // _DYNARRAY_H
 
index 21d1a42e53304c5d702b3d5052e8350b1081f245..997f2cfc6e41dd8bdd01378733716f1b4bc5d1f7 100644 (file)
@@ -30,7 +30,7 @@
 // this one if used by wxPaintDC only
 struct WXDLLEXPORT wxPaintDCInfo;
 
-WX_DECLARE_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
+WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
 
 // ----------------------------------------------------------------------------
 // DC classes
index faf42ede5f03d35ade2815bea695c7063e90d4e2..6d1d8c0ba6e89b2ccd69481b9e3f23b2a6d98989 100644 (file)
@@ -26,7 +26,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxListBoxNameStr;
   // define the array of list box items
   #include  <wx/dynarray.h>
 
-  WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
+  WX_DEFINE_EXPORTED_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
 
 #endif
 
index 265274a036d3b26a25465760f4eb536f406691bd..8b94e5ce8fb0efc2c3ce6e242c973749bb72c835 100644 (file)
@@ -34,7 +34,7 @@ class WXDLLEXPORT wxWindow;
 // array of notebook pages
 typedef wxWindow WXDLLEXPORT wxNotebookPage;  // so far, any window can be a page
 
-WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
+WX_DEFINE_EXPORTED_ARRAY(wxNotebookPage *, wxArrayPages);
 
 // ----------------------------------------------------------------------------
 // wxNotebook
index b193782490c2faad9996d97e88ef55de63c8586e..c143a0bf392cdeaef9e58b7207d0ee06c129f2e2 100644 (file)
@@ -122,7 +122,7 @@ protected:
     long m_itemId;
 };
 
-WX_DEFINE_ARRAY(wxTreeItemId, wxArrayTreeItemIds);
+WX_DEFINE_EXPORTED_ARRAY(wxTreeItemId, wxArrayTreeItemIds);
 
 // ----------------------------------------------------------------------------
 // wxTreeItemData is some (arbitrary) user class associated with some item. The
index 84042ca0196f6f3591b36d626355044830513f9a..6c617bb62498b6ae2c3ef4c047dc1fdbf589acba 100644 (file)
@@ -45,7 +45,7 @@ enum wxTextFileType
     wxTextFileType_Os2    //                         'CR' 'LF'
 };
 
-WX_DEFINE_ARRAY(wxTextFileType, ArrayFileType);
+WX_DEFINE_EXPORTED_ARRAY(wxTextFileType, ArrayFileType);
 
 class WXDLLEXPORT wxTextFile
 {
index 553b712a8a897806a677f45d9d8be09419a9e852..30f8556094231bd85b3da8c0f8d09576fe2cb34b 100644 (file)
@@ -84,7 +84,7 @@
        #include "wx/db.h"
 #endif
 
-DbList* WXDLLEXPORT PtrBegDbList = 0;
+DbList WXDLLEXPORT *PtrBegDbList = 0;
 
 #if __WXDEBUG__ > 0
         #if   wxMAJOR_VERSION == 2
@@ -1728,7 +1728,7 @@ DBMS wxDB::Dbms(void)
 
 
 /********** GetDbConnection() **********/
-wxDB* WXDLLEXPORT GetDbConnection(DbStuff *pDbStuff)
+wxDB WXDLLEXPORT *GetDbConnection(DbStuff *pDbStuff)
 {
        DbList *pList;
 
index c7c12b22e2cd4006d9f4e456af60feba5adfd4f0..e1d64f89b06b34e5dc0af80fd48bbadc11cab2de 100644 (file)
@@ -119,7 +119,7 @@ private:
                     m_ext;
 };
 
-WX_DECLARE_OBJARRAY(wxFileTypeInfo, wxArrayFileTypeInfo);
+WX_DECLARE_EXPORTED_OBJARRAY(wxFileTypeInfo, wxArrayFileTypeInfo);
 #include "wx/arrimpl.cpp"
 WX_DEFINE_OBJARRAY(wxArrayFileTypeInfo);
 
index 11f17d00a925a8064f68cfff420576c0763e84f1..88e8c99a5ce083e9023d12a341330bdf9f27337b 100644 (file)
@@ -1350,11 +1350,15 @@ GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf)
   return GSOCK_INVADDR;
 }
 
+#else /* !wxUSE_SOCKETS */
 
-#endif  /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
-
-
+/* 
+ * translation unit shouldn't be empty, so include this typedef to make the
+ * compiler (VC++ 6.0, for example) happy
+ */
+typedef (*wxDummy)();
 
+#endif  /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
 
 /* Diferencias con la version Unix:
  *  - El descriptor es SOCKET y no int