Remove a number of 'visibility' related warnings on linux.
git-svn-id: svn://10.0.0.236/trunk@187994 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -78,7 +78,9 @@ static void HandleLogError(const char *pszMessageText)
|
||||
|
||||
static const char *LOGGER_WARNING = "warning";
|
||||
static const char *LOGGER_ERROR = "error";
|
||||
#ifdef NS_DEBUG
|
||||
static const char *LOGGER_DEBUG = "debug";
|
||||
#endif
|
||||
|
||||
// Our "normal" error logger - calls back to the logging module.
|
||||
void DoLogMessage(const char *methodName, const char *pszMessageText)
|
||||
@@ -149,7 +151,7 @@ static void VLogF(const char *methodName, const char *fmt, va_list argptr)
|
||||
LogMessage(methodName, buff);
|
||||
}
|
||||
|
||||
PRBool PyXPCOM_FormatCurrentException(nsCString &streamout)
|
||||
PYXPCOM_EXPORT PRBool PyXPCOM_FormatCurrentException(nsCString &streamout)
|
||||
{
|
||||
PRBool ok = PR_FALSE;
|
||||
PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL;
|
||||
@@ -163,7 +165,7 @@ PRBool PyXPCOM_FormatCurrentException(nsCString &streamout)
|
||||
return ok;
|
||||
}
|
||||
|
||||
PRBool PyXPCOM_FormatGivenException(nsCString &streamout,
|
||||
PYXPCOM_EXPORT PRBool PyXPCOM_FormatGivenException(nsCString &streamout,
|
||||
PyObject *exc_typ, PyObject *exc_val,
|
||||
PyObject *exc_tb)
|
||||
{
|
||||
@@ -199,7 +201,7 @@ PRBool PyXPCOM_FormatGivenException(nsCString &streamout,
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
void PyXPCOM_LogError(const char *fmt, ...)
|
||||
PYXPCOM_EXPORT void PyXPCOM_LogError(const char *fmt, ...)
|
||||
{
|
||||
va_list marker;
|
||||
va_start(marker, fmt);
|
||||
@@ -218,20 +220,20 @@ void PyXPCOM_LogError(const char *fmt, ...)
|
||||
}
|
||||
}
|
||||
|
||||
void PyXPCOM_LogWarning(const char *fmt, ...)
|
||||
PYXPCOM_EXPORT void PyXPCOM_LogWarning(const char *fmt, ...)
|
||||
{
|
||||
va_list marker;
|
||||
va_start(marker, fmt);
|
||||
VLogF(LOGGER_WARNING, fmt, marker);
|
||||
}
|
||||
|
||||
void PyXPCOM_Log(const char *level, const nsCString &msg)
|
||||
PYXPCOM_EXPORT void PyXPCOM_Log(const char *level, const nsCString &msg)
|
||||
{
|
||||
DoLogMessage(level, msg.get());
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void PyXPCOM_LogDebug(const char *fmt, ...)
|
||||
PYXPCOM_EXPORT void PyXPCOM_LogDebug(const char *fmt, ...)
|
||||
{
|
||||
va_list marker;
|
||||
va_start(marker, fmt);
|
||||
@@ -240,7 +242,7 @@ void PyXPCOM_LogDebug(const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
PyObject *PyXPCOM_BuildPyException(nsresult r)
|
||||
PYXPCOM_EXPORT PyObject *PyXPCOM_BuildPyException(nsresult r)
|
||||
{
|
||||
// Need the message etc.
|
||||
PyObject *evalue = Py_BuildValue("i", r);
|
||||
@@ -249,7 +251,7 @@ PyObject *PyXPCOM_BuildPyException(nsresult r)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsresult PyXPCOM_SetCOMErrorFromPyException()
|
||||
PYXPCOM_EXPORT nsresult PyXPCOM_SetCOMErrorFromPyException()
|
||||
{
|
||||
if (!PyErr_Occurred())
|
||||
// No error occurred
|
||||
@@ -358,7 +360,7 @@ done:
|
||||
}
|
||||
|
||||
// See comments in PyXPCOM.h for why we need this!
|
||||
void PyXPCOM_MakePendingCalls()
|
||||
PYXPCOM_EXPORT void PyXPCOM_MakePendingCalls()
|
||||
{
|
||||
while (1) {
|
||||
int rc = Py_MakePendingCalls();
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
#include <nsIInputStream.h>
|
||||
|
||||
static PRInt32 cGateways = 0;
|
||||
PRInt32 _PyXPCOM_GetGatewayCount(void)
|
||||
|
||||
PYXPCOM_EXPORT PRInt32 _PyXPCOM_GetGatewayCount(void)
|
||||
{
|
||||
return cGateways;
|
||||
}
|
||||
@@ -60,9 +61,8 @@ extern PyG_Base *MakePyG_nsIModule(PyObject *);
|
||||
extern PyG_Base *MakePyG_nsIInputStream(PyObject *instance);
|
||||
|
||||
static char *PyXPCOM_szDefaultGatewayAttributeName = "_com_instance_default_gateway_";
|
||||
PyG_Base *GetDefaultGateway(PyObject *instance);
|
||||
void AddDefaultGateway(PyObject *instance, nsISupports *gateway);
|
||||
PRBool CheckDefaultGateway(PyObject *real_inst, REFNSIID iid, nsISupports **ret_gateway);
|
||||
static PyG_Base *GetDefaultGateway(PyObject *instance);
|
||||
static PRBool CheckDefaultGateway(PyObject *real_inst, REFNSIID iid, nsISupports **ret_gateway);
|
||||
|
||||
/*static*/ nsresult
|
||||
PyG_Base::CreateNew(PyObject *pPyInstance, const nsIID &iid, void **ppResult)
|
||||
@@ -807,7 +807,7 @@ PRBool CheckDefaultGateway(PyObject *real_inst, REFNSIID iid, nsISupports **ret_
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void AddDefaultGateway(PyObject *instance, nsISupports *gateway)
|
||||
PYXPCOM_EXPORT void AddDefaultGateway(PyObject *instance, nsISupports *gateway)
|
||||
{
|
||||
// NOTE: Instance is the _policy_!
|
||||
PyObject *real_inst = PyObject_GetAttrString(instance, "_obj_");
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "PyXPCOM_std.h"
|
||||
#include <nsIInterfaceInfoManager.h>
|
||||
|
||||
nsIID Py_nsIID_NULL = {0,0,0,{0,0,0,0,0,0,0,0}};
|
||||
PYXPCOM_EXPORT nsIID Py_nsIID_NULL = {0,0,0,{0,0,0,0,0,0,0,0}};
|
||||
|
||||
// @pymethod <o Py_nsIID>|xpcom|IID|Creates a new IID object
|
||||
PYXPCOM_EXPORT PyObject *PyXPCOMMethod_IID(PyObject *self, PyObject *args)
|
||||
@@ -137,7 +137,7 @@ Py_nsIID::IIDFromPyObject(PyObject *ob, nsIID *pRet) {
|
||||
// <nl>All pythoncom functions that return a CLSID/IID will return one of these
|
||||
// objects. However, in almost all cases, functions that expect a CLSID/IID
|
||||
// as a param will accept either a string object, or a native Py_nsIID object.
|
||||
PyTypeObject Py_nsIID::type =
|
||||
PYXPCOM_EXPORT PyTypeObject Py_nsIID::type =
|
||||
{
|
||||
PyObject_HEAD_INIT(&PyType_Type)
|
||||
0,
|
||||
|
||||
@@ -51,15 +51,16 @@
|
||||
static PRInt32 cInterfaces=0;
|
||||
static PyObject *g_obFuncMakeInterfaceCount = NULL; // XXX - never released!!!
|
||||
|
||||
PyObject *PyObject_FromNSInterface( nsISupports *aInterface,
|
||||
const nsIID &iid,
|
||||
PRBool bMakeNicePyObject /*= PR_TRUE */)
|
||||
PYXPCOM_EXPORT PyObject *
|
||||
PyObject_FromNSInterface(nsISupports *aInterface,
|
||||
const nsIID &iid,
|
||||
PRBool bMakeNicePyObject /*= PR_TRUE */)
|
||||
{
|
||||
return Py_nsISupports::PyObjectFromInterface(aInterface, iid,
|
||||
bMakeNicePyObject);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
PYXPCOM_EXPORT PRInt32
|
||||
_PyXPCOM_GetInterfaceCount(void)
|
||||
{
|
||||
return cInterfaces;
|
||||
@@ -442,7 +443,7 @@ Py_nsISupports::QueryInterface(PyObject *self, PyObject *args)
|
||||
|
||||
|
||||
// @object Py_nsISupports|The base object for all PythonCOM objects. Wraps a COM nsISupports interface.
|
||||
/*static*/ struct PyMethodDef
|
||||
NS_EXPORT_STATIC_MEMBER_(struct PyMethodDef)
|
||||
Py_nsISupports::methods[] =
|
||||
{
|
||||
{ "queryInterface", Py_nsISupports::QueryInterface, 1, "Queries the object for an interface."},
|
||||
@@ -460,5 +461,5 @@ Py_nsISupports::methods[] =
|
||||
Constructor);
|
||||
}
|
||||
|
||||
PyXPCOM_TypeObject *Py_nsISupports::type = NULL;
|
||||
PyObject *Py_nsISupports::mapIIDToType = NULL;
|
||||
NS_EXPORT_STATIC_MEMBER_(PyXPCOM_TypeObject *) Py_nsISupports::type = NULL;
|
||||
NS_EXPORT_STATIC_MEMBER_(PyObject *) Py_nsISupports::mapIIDToType = NULL;
|
||||
|
||||
@@ -748,7 +748,7 @@ extern struct PyMethodDef Methods[]; \
|
||||
class ClassName : public Py_nsISupports \
|
||||
{ \
|
||||
public: \
|
||||
static PyXPCOM_TypeObject *type; \
|
||||
static PYXPCOM_EXPORT PyXPCOM_TypeObject *type; \
|
||||
static Py_nsISupports *Constructor(nsISupports *pInitObj, const nsIID &iid) { \
|
||||
return new ClassName(pInitObj, iid); \
|
||||
} \
|
||||
@@ -775,7 +775,7 @@ protected: \
|
||||
// End of PyXPCOM_ATTR_INTERFACE_DECLARE macro
|
||||
|
||||
#define PyXPCOM_INTERFACE_DEFINE(ClassName, InterfaceName, Methods ) \
|
||||
PyXPCOM_TypeObject *ClassName::type = NULL;
|
||||
NS_EXPORT_STATIC_MEMBER_(PyXPCOM_TypeObject *) ClassName::type = NULL;
|
||||
|
||||
|
||||
// And the classes
|
||||
|
||||
@@ -107,7 +107,8 @@ PyUnicode_AsPRUnichar(PyObject *obj, PRUnichar **dest_out, PRUint32 *size_out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *PyObject_FromNSString( const nsACString &s, PRBool bAssumeUTF8 /*= PR_FALSE */)
|
||||
PYXPCOM_EXPORT PyObject *
|
||||
PyObject_FromNSString( const nsACString &s, PRBool bAssumeUTF8 /*= PR_FALSE */)
|
||||
{
|
||||
PyObject *ret;
|
||||
if (IsNullDOMString(s)) {
|
||||
@@ -130,7 +131,8 @@ PyObject *PyObject_FromNSString( const nsACString &s, PRBool bAssumeUTF8 /*= PR_
|
||||
return ret;
|
||||
}
|
||||
|
||||
PyObject *PyObject_FromNSString( const nsAString &s )
|
||||
PYXPCOM_EXPORT PyObject *
|
||||
PyObject_FromNSString( const nsAString &s )
|
||||
{
|
||||
PyObject *ret;
|
||||
if (IsNullDOMString(s)) {
|
||||
@@ -143,14 +145,16 @@ PyObject *PyObject_FromNSString( const nsAString &s )
|
||||
return ret;
|
||||
}
|
||||
|
||||
PyObject *PyObject_FromNSString( const PRUnichar *s,
|
||||
PRUint32 len /* = (PRUint32)-1*/)
|
||||
PYXPCOM_EXPORT PyObject *
|
||||
PyObject_FromNSString( const PRUnichar *s,
|
||||
PRUint32 len /* = (PRUint32)-1*/)
|
||||
{
|
||||
return PyUnicode_FromPRUnichar(s,
|
||||
len==((PRUint32)-1)? nsCRT::strlen(s) : len);
|
||||
}
|
||||
|
||||
PRBool PyObject_AsNSString( PyObject *val, nsAString &aStr)
|
||||
PYXPCOM_EXPORT PRBool
|
||||
PyObject_AsNSString( PyObject *val, nsAString &aStr)
|
||||
{
|
||||
if (val == Py_None) {
|
||||
aStr.Truncate();
|
||||
@@ -646,7 +650,8 @@ static PRUint16 BestVariantTypeForPyObject( PyObject *ob, BVFTResult *pdata = NU
|
||||
return (PRUint16)-1;
|
||||
}
|
||||
|
||||
nsresult PyObject_AsVariant( PyObject *ob, nsIVariant **aRet)
|
||||
PYXPCOM_EXPORT nsresult
|
||||
PyObject_AsVariant( PyObject *ob, nsIVariant **aRet)
|
||||
{
|
||||
nsresult nr = NS_OK;
|
||||
nsCOMPtr<nsIWritableVariant> v = do_CreateInstance("@mozilla.org/variant;1", &nr);
|
||||
@@ -785,7 +790,8 @@ PyObject *PyObject_FromVariantArray( Py_nsISupports *parent, nsIVariant *v)
|
||||
return ret;
|
||||
}
|
||||
|
||||
PyObject *PyObject_FromVariant( Py_nsISupports *parent, nsIVariant *v)
|
||||
PYXPCOM_EXPORT PyObject *
|
||||
PyObject_FromVariant( Py_nsISupports *parent, nsIVariant *v)
|
||||
{
|
||||
if (!v) {
|
||||
Py_INCREF(Py_None);
|
||||
|
||||
@@ -177,12 +177,15 @@ void PyXPCOM_ThreadState_Clear()
|
||||
////////////////////////////////////////////////////////////
|
||||
// Lock/exclusion global functions.
|
||||
//
|
||||
void PyXPCOM_AcquireGlobalLock(void)
|
||||
PYXPCOM_EXPORT void
|
||||
PyXPCOM_AcquireGlobalLock(void)
|
||||
{
|
||||
NS_PRECONDITION(g_lockMain != nsnull, "Cant acquire a NULL lock!");
|
||||
PR_Lock(g_lockMain);
|
||||
}
|
||||
void PyXPCOM_ReleaseGlobalLock(void)
|
||||
|
||||
PYXPCOM_EXPORT void
|
||||
PyXPCOM_ReleaseGlobalLock(void)
|
||||
{
|
||||
NS_PRECONDITION(g_lockMain != nsnull, "Cant release a NULL lock!");
|
||||
PR_Unlock(g_lockMain);
|
||||
@@ -262,7 +265,8 @@ struct DllInitializer {
|
||||
////////////////////////////////////////////////////////////
|
||||
// Other helpers/global functions.
|
||||
//
|
||||
PRBool PyXPCOM_Globals_Ensure()
|
||||
PYXPCOM_EXPORT PRBool
|
||||
PyXPCOM_Globals_Ensure()
|
||||
{
|
||||
PRBool rc = PR_TRUE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user