Bug 807112 - change MOZ_EXPORT_API and MOZ_IMPORT_API to not take the type. r=Waldo.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Wed, 31 Oct 2012 18:18:12 -0400
changeset 111989 6ed470203a3b6e7bcaf0dbc8ddab35840f8681d5
parent 111988 1008f2b0021641bedf2f473c2647cffd922dd80b
child 111990 e73c3d5719c52ba78fede4cd9f8c6014ccd07808
push id23783
push useremorley@mozilla.com
push dateThu, 01 Nov 2012 13:43:27 +0000
treeherdermozilla-central@71b2ea41dff7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs807112
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 807112 - change MOZ_EXPORT_API and MOZ_IMPORT_API to not take the type. r=Waldo.
js/src/jstypes.h
media/omx-plugin/OmxPlugin.cpp
media/omx-plugin/lib/ics/libstagefright/libstagefright.cpp
media/omx-plugin/lib/ics/libutils/libutils.cpp
memory/build/extraMallocFuncs.c
memory/build/mozjemalloc_compat.c
memory/mozjemalloc/jemalloc.h
mfbt/GuardObjects.h
mfbt/Types.h
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -41,37 +41,37 @@
 **   in dowhim.h
 **     JS_EXTERN_API( void ) DoWhatIMean( void );
 **   in dowhim.c
 **     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }
 **
 **
 ***********************************************************************/
 
-#define JS_EXTERN_API(type)  extern MOZ_EXPORT_API(type)
-#define JS_EXPORT_API(type)  MOZ_EXPORT_API(type)
-#define JS_EXPORT_DATA(type) MOZ_EXPORT_DATA(type)
-#define JS_IMPORT_API(type)  MOZ_IMPORT_API(type)
-#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA(type)
+#define JS_EXTERN_API(type)  extern MOZ_EXPORT type
+#define JS_EXPORT_API(type)  MOZ_EXPORT type
+#define JS_EXPORT_DATA(type) MOZ_EXPORT type
+#define JS_IMPORT_API(type)  MOZ_IMPORT_API type
+#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type
 
 /*
  * The linkage of JS API functions differs depending on whether the file is
  * used within the JS library or not. Any source file within the JS
  * interpreter should define EXPORT_JS_API whereas any client of the library
  * should not. STATIC_JS_API is used to build JS as a static library.
  */
 #if defined(STATIC_JS_API)
 #  define JS_PUBLIC_API(t)   t
 #  define JS_PUBLIC_DATA(t)  t
 #elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)
-#  define JS_PUBLIC_API(t)   MOZ_EXPORT_API(t)
-#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT_DATA(t)
+#  define JS_PUBLIC_API(t)   MOZ_EXPORT t
+#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t
 #else
-#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API(t)
-#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA(t)
+#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t
+#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t
 #endif
 
 #define JS_FRIEND_API(t)    JS_PUBLIC_API(t)
 #define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)
 
 #if defined(_MSC_VER) && defined(_M_IX86)
 #define JS_FASTCALL __fastcall
 #elif defined(__GNUC__) && defined(__i386__) &&                         \
--- a/media/omx-plugin/OmxPlugin.cpp
+++ b/media/omx-plugin/OmxPlugin.cpp
@@ -888,12 +888,12 @@ static bool CreateDecoder(PluginHost *aP
   aDecoder->DestroyDecoder = DestroyDecoder;
 
   return true;
 }
 
 } // namespace OmxPlugin
 
 // Export the manifest so MPAPI can find our entry points.
-Manifest MOZ_EXPORT_DATA(MPAPI_MANIFEST) {
+Manifest MOZ_EXPORT MPAPI_MANIFEST {
   OmxPlugin::CanDecode,
   OmxPlugin::CreateDecoder
 };
--- a/media/omx-plugin/lib/ics/libstagefright/libstagefright.cpp
+++ b/media/omx-plugin/lib/ics/libstagefright/libstagefright.cpp
@@ -14,152 +14,152 @@
 #include "media/stagefright/openmax/OMX_Index.h"
 #include "media/stagefright/openmax/OMX_IVCommon.h"
 #include "media/stagefright/openmax/OMX_Video.h"
 #include "media/stagefright/openmax/OMX_Core.h"
 #include "stagefright/OMXCodec.h"
 #include "stagefright/OMXClient.h"
 
 namespace android {
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 MediaBuffer::release()
 {
 }
 
-MOZ_EXPORT_API(size_t)
+MOZ_EXPORT size_t
 MediaBuffer::range_offset() const
 {
   return 0;
 }
 
-MOZ_EXPORT_API(size_t)
+MOZ_EXPORT size_t
 MediaBuffer::range_length() const
 {
   return 0;
 }
 
-MOZ_EXPORT_API(sp<MetaData>)
+MOZ_EXPORT sp<MetaData>
 MediaBuffer::meta_data()
 {
   return 0;
 }
 
-MOZ_EXPORT_API(void*)
+MOZ_EXPORT void*
 MediaBuffer::data() const
 {
   return 0;
 }
 
-MOZ_EXPORT_API(size_t)
+MOZ_EXPORT size_t
 MediaBuffer::size() const
 {
   return 0;
 }
 
-MOZ_EXPORT_API(bool)
+MOZ_EXPORT bool
 MetaData::findInt32(uint32_t key, int32_t *value)
 {
   return false;
 }
 
-MOZ_EXPORT_API(bool)
+MOZ_EXPORT bool
 MetaData::findInt64(uint32_t key, int64_t *value)
 {
   return false;
 }
 
-MOZ_EXPORT_API(bool)
+MOZ_EXPORT bool
 MetaData::findPointer(uint32_t key, void **value)
 {
   return false;
 }
 
-MOZ_EXPORT_API(bool)
+MOZ_EXPORT bool
 MetaData::findCString(uint32_t key, const char **value)
 {
   return false;
 }
 
-MOZ_EXPORT_API(bool)
+MOZ_EXPORT bool
 MetaData::findRect(unsigned int key, int *cropLeft, int *cropTop,
                    int *cropRight, int *cropBottom)
 {
   abort();
 }
 
-MOZ_EXPORT_API(MediaSource::ReadOptions)::ReadOptions()
+MOZ_EXPORT MediaSource::ReadOptions::ReadOptions()
 {
 }
 
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 MediaSource::ReadOptions::setSeekTo(int64_t time_us, SeekMode mode)
 {
 }
 
-MOZ_EXPORT_API(bool)
+MOZ_EXPORT bool
 DataSource::getUInt16(off64_t offset, uint16_t *x)
 {
   return false;
 }
 
-MOZ_EXPORT_API(status_t)
+MOZ_EXPORT status_t
 DataSource::getSize(off64_t *size)
 {
   return 0;
 }
 
-MOZ_EXPORT_API(String8)
+MOZ_EXPORT String8
 DataSource::getMIMEType() const
 {
   return String8();
 }
 
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 DataSource::RegisterDefaultSniffers()
 {
 }
 
-MOZ_EXPORT_API(sp<MediaExtractor>)
+MOZ_EXPORT sp<MediaExtractor>
 MediaExtractor::Create(const sp<DataSource> &source, const char *mime)
 {
   return 0;
 }
 
-MOZ_EXPORT_API(sp<MediaSource>)
+MOZ_EXPORT sp<MediaSource>
 OMXCodec::Create(
             const sp<IOMX> &omx,
             const sp<MetaData> &meta, bool createEncoder,
             const sp<MediaSource> &source,
             const char *matchComponentName,
             uint32_t flags,
             const sp<ANativeWindow> &nativeWindow)
 {
   return 0;
 }
 
-MOZ_EXPORT_API(OMXClient)::OMXClient()
+MOZ_EXPORT OMXClient::OMXClient()
 {
 }
 
-MOZ_EXPORT_API(status_t) OMXClient::connect()
+MOZ_EXPORT status_t OMXClient::connect()
 {
   return OK;
 }
 
-MOZ_EXPORT_API(void) OMXClient::disconnect()
+MOZ_EXPORT void OMXClient::disconnect()
 {
 }
 
 class __attribute__ ((visibility ("default"))) UnknownDataSource : public DataSource {
 public:
 UnknownDataSource();
 
 virtual status_t initCheck() const { return 0; }
 virtual ssize_t readAt(off64_t offset, void *data, size_t size) { return 0; }
 virtual status_t getSize(off64_t *size) { return 0; }
 
 virtual ~UnknownDataSource() { }
 };
 
 UnknownDataSource foo;
 
-MOZ_EXPORT_API(UnknownDataSource)::UnknownDataSource() { }
+MOZ_EXPORT UnknownDataSource::UnknownDataSource() { }
 }
--- a/media/omx-plugin/lib/ics/libutils/libutils.cpp
+++ b/media/omx-plugin/lib/ics/libutils/libutils.cpp
@@ -4,57 +4,57 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "mozilla/Types.h"
 #include "utils/RefBase.h"
 #include "utils/String16.h"
 #include "utils/String8.h"
 
 namespace android {
-MOZ_EXPORT_API(RefBase)::RefBase() : mRefs(0)
+MOZ_EXPORT RefBase::RefBase() : mRefs(0)
 {
 }
 
-MOZ_EXPORT_API(RefBase)::~RefBase()
+MOZ_EXPORT RefBase::~RefBase()
 {
 }
 
-MOZ_EXPORT_API(void) RefBase::incStrong(const void *id) const
+MOZ_EXPORT void RefBase::incStrong(const void *id) const
 {
 }
 
-MOZ_EXPORT_API(void) RefBase::decStrong(const void *id) const
+MOZ_EXPORT void RefBase::decStrong(const void *id) const
 {
 }
 
-MOZ_EXPORT_API(void) RefBase::onFirstRef()
+MOZ_EXPORT void RefBase::onFirstRef()
 {
 }
 
-MOZ_EXPORT_API(void) RefBase::onLastStrongRef(const void* id)
+MOZ_EXPORT void RefBase::onLastStrongRef(const void* id)
 {
 }
 
-MOZ_EXPORT_API(bool) RefBase::onIncStrongAttempted(uint32_t flags, const void* id)
+MOZ_EXPORT bool RefBase::onIncStrongAttempted(uint32_t flags, const void* id)
 {
   return false;
 }
 
-MOZ_EXPORT_API(void) RefBase::onLastWeakRef(void const* id)
+MOZ_EXPORT void RefBase::onLastWeakRef(void const* id)
 {
 }
 
-MOZ_EXPORT_API(String16)::String16(char const*)
+MOZ_EXPORT String16::String16(char const*)
 {
 }
 
-MOZ_EXPORT_API(String16)::~String16()
+MOZ_EXPORT String16::~String16()
 {
 }
 
-MOZ_EXPORT_API(String8)::String8()
+MOZ_EXPORT String8::String8()
 {
 }
 
-MOZ_EXPORT_API(String8)::~String8()
+MOZ_EXPORT String8::~String8()
 {
 }
 }
--- a/memory/build/extraMallocFuncs.c
+++ b/memory/build/extraMallocFuncs.c
@@ -15,76 +15,76 @@
 
 #ifdef wrap
 void *wrap(malloc)(size_t);
 void wrap(free)(void *);
 #endif
 
 #ifdef ANDROID
 /* operator new(unsigned int) */
-MOZ_EXPORT_API(void *)
+MOZ_EXPORT void *
 wrap(_Znwj)(unsigned int size)
 {
   return wrap(malloc)(size);
 }
 /* operator new[](unsigned int) */
-MOZ_EXPORT_API(void *)
+MOZ_EXPORT void *
 wrap(_Znaj)(unsigned int size)
 {
   return wrap(malloc)(size);
 }
 /* operator delete(void*) */
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 wrap(_ZdlPv)(void *ptr)
 {
   wrap(free)(ptr);
 }
 /* operator delete[](void*) */
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 wrap(_ZdaPv)(void *ptr)
 {
   wrap(free)(ptr);
 }
 /*operator new(unsigned int, std::nothrow_t const&)*/
-MOZ_EXPORT_API(void *)
+MOZ_EXPORT void *
 wrap(_ZnwjRKSt9nothrow_t)(unsigned int size)
 {
   return wrap(malloc)(size);
 }
 /*operator new[](unsigned int, std::nothrow_t const&)*/
-MOZ_EXPORT_API(void *)
+MOZ_EXPORT void *
 wrap(_ZnajRKSt9nothrow_t)(unsigned int size)
 {
   return wrap(malloc)(size);
 }
 /* operator delete(void*, std::nothrow_t const&) */
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 wrap(_ZdlPvRKSt9nothrow_t)(void *ptr)
 {
   wrap(free)(ptr);
 }
 /* operator delete[](void*, std::nothrow_t const&) */
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 wrap(_ZdaPvRKSt9nothrow_t)(void *ptr)
 {
   wrap(free)(ptr);
 }
 #endif
 
 #ifdef wrap
-MOZ_EXPORT_API(char *)
+MOZ_EXPORT char *
 wrap(strndup)(const char *src, size_t len)
 {
   char* dst = (char*) wrap(malloc)(len + 1);
   if (dst)
     strncpy(dst, src, len + 1);
   return dst; 
 }
 
-MOZ_EXPORT_API(char *)
+MOZ_EXPORT char *
 wrap(strdup)(const char *src)
 {
   size_t len = strlen(src);
   return wrap(strndup)(src, len);
 }
 
 #ifdef XP_WIN
 /*
@@ -122,17 +122,17 @@ wrap(wcsdup)(const wchar_t *src)
 #undef wrap
 #if defined(MOZ_NATIVE_JEMALLOC)
 #define wrap(a) a
 #else
 #define wrap(a) je_ ## a
 #endif
 
 /* Override some jemalloc defaults */
-MOZ_EXPORT_DATA(const char *) wrap(malloc_conf) = "narenas:1,lg_chunk:20";
+MOZ_EXPORT const char * wrap(malloc_conf) = "narenas:1,lg_chunk:20";
 
 #ifdef ANDROID
 #include <android/log.h>
 
 static void
 _je_malloc_message(void *cbopaque, const char *s)
 {
   __android_log_print(ANDROID_LOG_INFO, "GeckoJemalloc", "%s", s);
--- a/memory/build/mozjemalloc_compat.c
+++ b/memory/build/mozjemalloc_compat.c
@@ -26,24 +26,24 @@
 	size_t mib[6];							\
 	size_t miblen = sizeof(mib) / sizeof(mib[0]);			\
 	size_t sz = sizeof(v);						\
 	wrap(mallctlnametomib)(n, mib, &miblen);			\
 	mib[2] = i;							\
 	wrap(mallctlbymib)(mib, miblen, &v, &sz, NULL, 0);		\
 } while (0)
 
-MOZ_IMPORT_API(int)
+MOZ_IMPORT_API int
 wrap(mallctl)(const char*, void*, size_t*, void*, size_t);
-MOZ_IMPORT_API(int)
+MOZ_IMPORT_API int
 wrap(mallctlnametomib)(const char *name, size_t *mibp, size_t *miblenp);
-MOZ_IMPORT_API(int)
+MOZ_IMPORT_API int
 wrap(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
 
-MOZ_EXPORT_API(void)
+MOZ_EXPORT void
 jemalloc_stats(jemalloc_stats_t *stats)
 {
   unsigned narenas;
   size_t active, allocated, mapped, page, pdirty;
 
   CTL_GET("arenas.narenas", narenas);
   CTL_GET("arenas.page", page);
   CTL_GET("stats.active", active);
--- a/memory/mozjemalloc/jemalloc.h
+++ b/memory/mozjemalloc/jemalloc.h
@@ -54,17 +54,17 @@ extern "C" {
 void	jemalloc_stats(jemalloc_stats_t *stats);
 
 /* Computes the usable size in advance. */
 #if !defined(MOZ_MEMORY_DARWIN)
 #if defined(MOZ_MEMORY_LINUX) || defined(MOZ_MEMORY_BSD)
 __attribute__((weak))
 #endif
 #if defined(MOZ_JEMALLOC)
-MOZ_IMPORT_API(int) wrap(nallocm)(size_t *rsize, size_t size, int flags);
+MOZ_IMPORT_API int wrap(nallocm)(size_t *rsize, size_t size, int flags);
 #else
 size_t je_malloc_good_size(size_t size);
 #endif
 #endif
 
 static inline size_t je_malloc_usable_size_in_advance(size_t size) {
 #if defined(MOZ_MEMORY_DARWIN)
   return malloc_good_size(size);
--- a/mfbt/GuardObjects.h
+++ b/mfbt/GuardObjects.h
@@ -61,34 +61,34 @@ namespace detail {
  *     a base class that also uses these macros
  *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each
  *     constructor. It uses the parameter declared by
  *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.
  *
  * For more details, and examples of using these macros, see
  * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla
  */
-class MOZ_EXPORT_API(GuardObjectNotifier)
+class MOZ_EXPORT GuardObjectNotifier
 {
   private:
     bool* statementDone;
 
   public:
     GuardObjectNotifier() : statementDone(NULL) { }
 
     ~GuardObjectNotifier() {
       *statementDone = true;
     }
 
     void setStatementDone(bool* statementIsDone) {
       statementDone = statementIsDone;
     }
 };
 
-class MOZ_EXPORT_API(GuardObjectNotificationReceiver)
+class MOZ_EXPORT GuardObjectNotificationReceiver
 {
   private:
     bool statementDone;
 
   public:
     GuardObjectNotificationReceiver() : statementDone(false) { }
 
     ~GuardObjectNotificationReceiver() {
--- a/mfbt/Types.h
+++ b/mfbt/Types.h
@@ -22,115 +22,107 @@
 #include "mozilla/StandardInteger.h"
 
 /* Also expose size_t. */
 #include <stddef.h>
 
 /* Implement compiler and linker macros needed for APIs. */
 
 /*
- * MOZ_EXPORT_API is used to declare and define a method which is externally
+ * MOZ_EXPORT is used to declare and define a symbol or type which is externally
  * visible to users of the current library.  It encapsulates various decorations
- * needed to properly export the method's symbol.  MOZ_EXPORT_DATA serves the
- * same purpose for data.
+ * needed to properly export the method's symbol.
  *
  *   api.h:
- *     extern MOZ_EXPORT_API(int) MeaningOfLife(void);
- *     extern MOZ_EXPORT_DATA(int) LuggageCombination;
+ *     extern MOZ_EXPORT int MeaningOfLife(void);
+ *     extern MOZ_EXPORT int LuggageCombination;
  *
  *   api.c:
- *     MOZ_EXPORT_API(int) MeaningOfLife(void) { return 42; }
- *     MOZ_EXPORT_DATA(int) LuggageCombination = 12345;
+ *     int MeaningOfLife(void) { return 42; }
+ *     int LuggageCombination = 12345;
  *
  * If you are merely sharing a method across files, just use plain |extern|.
  * These macros are designed for use by library interfaces -- not for normal
  * methods or data used cross-file.
  */
 #if defined(WIN32) || defined(XP_OS2)
-#  define MOZ_EXPORT_DIRECTIVE  __declspec(dllexport)
+#  define MOZ_EXPORT   __declspec(dllexport)
 #else /* Unix */
 #  ifdef HAVE_VISIBILITY_ATTRIBUTE
-#    define MOZ_EXTERNAL_VIS       __attribute__((visibility("default")))
+#    define MOZ_EXPORT       __attribute__((visibility("default")))
 #  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#    define MOZ_EXTERNAL_VIS      __global
+#    define MOZ_EXPORT      __global
 #  else
-#    define MOZ_EXTERNAL_VIS
+#    define MOZ_EXPORT /* nothing */
 #  endif
-#  define MOZ_EXPORT_DIRECTIVE   MOZ_EXTERNAL_VIS
 #endif
 
-#define MOZ_EXPORT_API(type)    MOZ_EXPORT_DIRECTIVE type
-#define MOZ_EXPORT_DATA(type)   MOZ_EXPORT_DIRECTIVE type
 
 /*
- * Whereas implementers use MOZ_EXPORT_API and MOZ_EXPORT_DATA to declare and
- * define library symbols, users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to
- * access them.  Most often the implementer of the library will expose an API
- * macro which expands to either the export or import version of the macro,
- * depending upon the compilation mode.
+ * Whereas implementers use MOZ_EXPORT to declare and define library symbols,
+ * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the
+ * implementer of the library will expose an API macro which expands to either
+ * the export or import version of the macro, depending upon the compilation
+ * mode.
  */
 #ifdef _WIN32
 #  if defined(__MWERKS__)
-#    define MOZ_IMPORT_API_DIRECTIVE /* nothing */
+#    define MOZ_IMPORT_API /* nothing */
 #  else
-#    define MOZ_IMPORT_API_DIRECTIVE __declspec(dllimport)
+#    define MOZ_IMPORT_API __declspec(dllimport)
 #  endif
 #elif defined(XP_OS2)
-#  define MOZ_IMPORT_API_DIRECTIVE  __declspec(dllimport)
+#  define MOZ_IMPORT_API  __declspec(dllimport)
 #else
-#  define MOZ_IMPORT_API_DIRECTIVE MOZ_EXPORT_DIRECTIVE
+#  define MOZ_IMPORT_API MOZ_EXPORT
 #endif
 
-#define MOZ_IMPORT_API(x)    MOZ_IMPORT_API_DIRECTIVE x
-
 #if defined(_WIN32) && !defined(__MWERKS__)
-#  define MOZ_IMPORT_DATA_DIRECTIVE __declspec(dllimport)
+#  define MOZ_IMPORT_DATA  __declspec(dllimport)
 #elif defined(XP_OS2)
-#  define MOZ_IMPORT_DATA_DIRECTIVE __declspec(dllimport)
+#  define MOZ_IMPORT_DATA  __declspec(dllimport)
 #else
-#  define MOZ_IMPORT_DATA_DIRECTIVE MOZ_EXPORT_DIRECTIVE
+#  define MOZ_IMPORT_DATA  MOZ_EXPORT
 #endif
 
-#define MOZ_IMPORT_DATA(x)    MOZ_IMPORT_DATA_DIRECTIVE x
-
 /*
  * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose
  * export mfbt declarations when building mfbt, and they expose import mfbt
  * declarations when using mfbt.
  */
 #if defined(IMPL_MFBT)
-#  define MFBT_API     MOZ_EXPORT_DIRECTIVE
-#  define MFBT_DATA    MOZ_EXPORT_DIRECTIVE
+#  define MFBT_API     MOZ_EXPORT
+#  define MFBT_DATA    MOZ_EXPORT
 #else
   /*
    * On linux mozglue is linked in the program and we link libxul.so with
    * -z,defs. Normally that causes the linker to reject undefined references in
    * libxul.so, but as a loophole it allows undefined references to weak
    * symbols. We add the weak attribute to the import version of the MFBT API
    * macros to exploit this.
    */
 #  if defined(MOZ_GLUE_IN_PROGRAM)
-#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API_DIRECTIVE
-#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA_DIRECTIVE
+#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API
+#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA
 #  else
-#    define MFBT_API   MOZ_IMPORT_API_DIRECTIVE
-#    define MFBT_DATA  MOZ_IMPORT_DATA_DIRECTIVE
+#    define MFBT_API   MOZ_IMPORT_API
+#    define MFBT_DATA  MOZ_IMPORT_DATA
 #  endif
 #endif
 
 /*
  * C symbols in C++ code must be declared immediately within |extern "C"|
  * blocks.  However, in C code, they need not be declared specially.  This
  * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C
  * macros, so that the user need not know whether he is being used in C or C++
  * code.
  *
  *   MOZ_BEGIN_EXTERN_C
  *
- *   extern MOZ_EXPORT_API(int) MostRandomNumber(void);
+ *   extern MOZ_EXPORT int MostRandomNumber(void);
  *   ...other declarations...
  *
  *   MOZ_END_EXTERN_C
  *
  * This said, it is preferable to just use |extern "C"| in C++ header files for
  * its greater clarity.
  */
 #ifdef __cplusplus