Tamas TEVESZ <[email protected]> wrote:
> On Mon, 27 Sep 2010, Andreas Metzler wrote:
> > Tamas TEVESZ <[email protected]> wrote:
[...] 
> > > one thing, __wmessage is supposed to be private, really, but since 
> > > there's no private wutil.h, and i'm not sure it makes sense at this 
> > > point to have one, for a lack of a better idea, it's in wutil.h.
[...]
> > afaiu we have the choice of 
> > either 
> > a) wmessage/wwarning/etc. being macros that expand to __wmessage
> >    AND __wmessage also being defined in a public header. (Which makes
> >    it a public function)
> > or
> > b) wmessage/wwarning/etc. being wrapper *functions* that expanded
> > behind the scens to the non-public function __wmessage.

> yeah, but *technically* we don't hide __wmessage() (at least not now). 
> despite this, it really isn't supposed to be used directly.
[...]

Hello,
There should be a big fat warning not to do so near the declaration.

> with that 
> in mind, should the changing of its semantics be listed in news? i'm 
> thinking, it might suggest funny ideas (using it or something).

I think it should be listed (perhaps with a warning) since afaik the
conversion breaks the ABI.

How about this:
---------------------------------
diff --git a/WINGs/NEWS b/WINGs/NEWS
index 6cec343..2720d3f 100644
--- a/WINGs/NEWS
+++ b/WINGs/NEWS
@@ -11,7 +11,8 @@ WMGetTextFieldCursorPosition ADDED
 enum WMConnectionState REMOVED
 enum WMConnectionTimeoutState REMOVED
 struct ConnectionDelegate REMOVED
-__wmessage ADDED
+__wmessage ADDED (Private function. Direct usage in applications is not
+supported, please use wmessage, wwarning, etc.)
 wstrerror REMOVED
 wmessage converted from function to wrapper macro
 wwarning converted from function to wrapper macro
diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h
index cc1a321..b73b8bd 100644
--- a/WINGs/WINGs/WUtil.h
+++ b/WINGs/WINGs/WUtil.h
@@ -187,6 +187,9 @@ enum {
 #define werror(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, 
WMESSAGE_TYPE_ERROR, fmt, ## args)
 #define wfatal(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, 
WMESSAGE_TYPE_FATAL, fmt, ## args)
 
+
+/* Private function, not part of the supported API. Applications should use
+ *  macros defined above. */
 void __wmessage(const char *func, const char *file, int line, int type, const 
char *msg, ...)
        __attribute__((__format__(printf,5,6)));
 
---------------------------------

cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'


-- 
To unsubscribe, send mail to [email protected].

Reply via email to