Bug 1400096 - Annotate mozmemory_wrap.c windows functions as MOZ_MEMORY_API. r?njn draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Sep 2017 10:12:24 +0900
changeset 665199 52c6cc7b1d6e6607a9cc58f2788f9ff748fed264
parent 665198 af2a0f74748a205d5f7ab76218a0ead8ee866143
child 665200 6ed418b99cfe5290b4b1391a522cf18ef7a8e28a
child 665218 d6874c3d967744d1a2c71638b71bdca08dd3cf93
push id79961
push userbmo:mh+mozilla@glandium.org
push dateFri, 15 Sep 2017 02:20:00 +0000
reviewersnjn
bugs1400096
milestone57.0a1
Bug 1400096 - Annotate mozmemory_wrap.c windows functions as MOZ_MEMORY_API. r?njn It happens to work because of mozglue.def, but we might as well have the right annotations (which will also make things correct when building this file to C++)
memory/build/mozmemory_wrap.c
--- a/memory/build/mozmemory_wrap.c
+++ b/memory/build/mozmemory_wrap.c
@@ -143,24 +143,24 @@ asprintf_impl(char **str, const char *fm
 
 #ifdef XP_WIN
 #include <wchar.h>
 
 /*
  *  We also need to provide our own impl of wcsdup so that we don't ask
  *  the CRT for memory from its heap (which will then be unfreeable).
  */
-wchar_t *
-wcsdup_impl(const wchar_t *src)
+MOZ_MEMORY_API wchar_t*
+wcsdup_impl(const wchar_t* src)
 {
   size_t len = wcslen(src);
   wchar_t *dst = (wchar_t*) malloc_impl((len + 1) * sizeof(wchar_t));
   if (dst)
     wcsncpy(dst, src, len + 1);
   return dst;
 }
 
-void *
+MOZ_MEMORY_API void*
 _aligned_malloc(size_t size, size_t alignment)
 {
   return memalign_impl(alignment, size);
 }
 #endif /* XP_WIN */