Bug 1306329 - Stop exporting XPCOM and XUL symbols. r=glandium

--HG--
extra : rebase_source : 8c700498470b42279197f316d553154b1f2ed235
This commit is contained in:
Benjamin Smedberg 2016-12-02 12:55:34 -05:00
Родитель 3caf6299aa
Коммит d616a7ec44
6 изменённых файлов: 13 добавлений и 36 удалений

Просмотреть файл

@ -26,7 +26,6 @@ void CSFLog(CSFLogLevel priority, const char* sourceFile, int sourceLine, const
va_end(ap); va_end(ap);
} }
extern "C" {
void NS_DebugBreak(uint32_t aSeverity, void NS_DebugBreak(uint32_t aSeverity,
const char* aStr, const char* aExpr, const char* aStr, const char* aExpr,
const char* aFile, int32_t aLine) const char* aFile, int32_t aLine)
@ -34,7 +33,6 @@ void NS_DebugBreak(uint32_t aSeverity,
fprintf(stderr, "NS_DebugBreak: %u %s %s %s %u", aSeverity, aStr, aExpr, fprintf(stderr, "NS_DebugBreak: %u %s %s %s %u", aSeverity, aStr, aExpr,
aFile, aLine); aFile, aLine);
} }
} // end extern "C".
namespace mozilla { namespace mozilla {

Просмотреть файл

@ -272,7 +272,7 @@ namespace mozilla {
LibFuzzerRunner* libFuzzerRunner = 0; LibFuzzerRunner* libFuzzerRunner = 0;
} // namespace mozilla } // namespace mozilla
extern "C" MOZ_EXPORT void XRE_LibFuzzerSetMain(int argc, char** argv, LibFuzzerMain main) { void XRE_LibFuzzerSetMain(int argc, char** argv, LibFuzzerMain main) {
mozilla::libFuzzerRunner->setParams(argc, argv, main); mozilla::libFuzzerRunner->setParams(argc, argv, main);
} }
#endif #endif

Просмотреть файл

@ -5,13 +5,11 @@
#include "LibFuzzerRegistry.h" #include "LibFuzzerRegistry.h"
extern "C" { void XRE_LibFuzzerGetFuncs(const char* moduleName, LibFuzzerInitFunc* initFunc, LibFuzzerTestingFunc* testingFunc) {
void MOZ_EXPORT XRE_LibFuzzerGetFuncs(const char* moduleName, LibFuzzerInitFunc* initFunc, LibFuzzerTestingFunc* testingFunc) { std::string moduleNameStr(moduleName);
std::string moduleNameStr(moduleName); mozilla::LibFuzzerFunctions funcs = mozilla::LibFuzzerRegistry::getInstance().getModuleFunctions(moduleNameStr);
mozilla::LibFuzzerFunctions funcs = mozilla::LibFuzzerRegistry::getInstance().getModuleFunctions(moduleNameStr); *initFunc = funcs.first;
*initFunc = funcs.first; *testingFunc = funcs.second;
*testingFunc = funcs.second;
}
} }
namespace mozilla { namespace mozilla {

Просмотреть файл

@ -175,23 +175,11 @@
* Import/Export macros for XPCOM APIs * Import/Export macros for XPCOM APIs
*/ */
#ifdef __cplusplus #define EXPORT_XPCOM_API(type) type
#define NS_EXTERN_C extern "C" #define IMPORT_XPCOM_API(type) type
#else #define GLUE_XPCOM_API(type) type
#define NS_EXTERN_C
#endif
#define EXPORT_XPCOM_API(type) NS_EXTERN_C NS_EXPORT type NS_FROZENCALL #define XPCOM_API(type) type
#define IMPORT_XPCOM_API(type) NS_EXTERN_C NS_IMPORT type NS_FROZENCALL
#define GLUE_XPCOM_API(type) NS_EXTERN_C NS_HIDDEN_(type) NS_FROZENCALL
#ifdef IMPL_LIBXUL
#define XPCOM_API(type) EXPORT_XPCOM_API(type)
#elif defined(XPCOM_GLUE)
#define XPCOM_API(type) GLUE_XPCOM_API(type)
#else
#define XPCOM_API(type) IMPORT_XPCOM_API(type)
#endif
#ifdef MOZILLA_INTERNAL_API #ifdef MOZILLA_INTERNAL_API
/* /*

Просмотреть файл

@ -12,14 +12,6 @@
/** /**
* Import/export macros for libXUL APIs. * Import/export macros for libXUL APIs.
*/ */
#ifdef XPCOM_GLUE #define XRE_API(type, name, params) type name params;
#define XRE_API(type, name, params) \
typedef type (NS_FROZENCALL * name##Type) params; \
extern name##Type name NS_HIDDEN;
#elif defined(IMPL_LIBXUL)
#define XRE_API(type, name, params) EXPORT_XPCOM_API(type) name params;
#else
#define XRE_API(type, name, params) IMPORT_XPCOM_API(type) name params;
#endif
#endif // xrecore_h__ #endif // xrecore_h__

Просмотреть файл

@ -186,7 +186,8 @@ NS_DestroyXPTCallStub(nsISomeInterface* aStub);
XPCOM_API(size_t) XPCOM_API(size_t)
NS_SizeOfIncludingThisXPTCallStub(const nsISomeInterface* aStub, mozilla::MallocSizeOf aMallocSizeOf); NS_SizeOfIncludingThisXPTCallStub(const nsISomeInterface* aStub, mozilla::MallocSizeOf aMallocSizeOf);
XPCOM_API(nsresult) // this is extern "C" because on some platforms it is implemented in assembly
extern "C" nsresult
NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
uint32_t paramCount, nsXPTCVariant* params); uint32_t paramCount, nsXPTCVariant* params);