Bug 1080998 - Build libjsctypes-test without a dependency on mozalloc or mozglue. r=jorendorff

This commit is contained in:
Mike Hommey 2014-10-15 14:46:38 +09:00
parent f431c6c5b5
commit 416a78f1fa
6 changed files with 54 additions and 44 deletions

View File

@ -9,3 +9,5 @@ INSTALL_TARGETS += LIB_1
LIB_3_FILES = $(SHARED_LIBRARY)
LIB_3_DEST = $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/chrome
INSTALL_TARGETS += LIB_3
MOZ_GLUE_LDFLAGS =

View File

@ -3,13 +3,13 @@
* 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 "nscore.h"
#include "mozilla/Attributes.h"
#include "mozilla/Types.h"
#define EXPORT_CDECL(type) NS_EXPORT type
#define EXPORT_STDCALL(type) NS_EXPORT type NS_STDCALL
#define EXPORT_CDECL(type) MOZ_EXPORT type
MOZ_BEGIN_EXTERN_C
NS_EXTERN_C
{
EXPORT_CDECL(void) set_errno(int status);
EXPORT_CDECL(int) get_errno();
@ -17,4 +17,5 @@ NS_EXTERN_C
EXPORT_CDECL(void) set_last_error(int status);
EXPORT_CDECL(int) get_last_error();
#endif // defined(XP_WIN)
}
MOZ_END_EXTERN_C

View File

@ -2,10 +2,13 @@
* 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/. */
#define EXPORT_CDECL(type) NS_EXPORT type
#include "mozilla/Attributes.h"
#include "mozilla/Types.h"
#define EXPORT_CDECL(type) MOZ_EXPORT type
MOZ_BEGIN_EXTERN_C
NS_EXTERN_C
{
EXPORT_CDECL(void) test_finalizer_start(size_t size);
EXPORT_CDECL(void) test_finalizer_stop();
EXPORT_CDECL(bool) test_finalizer_resource_is_acquired(size_t i);
@ -51,4 +54,4 @@ NS_EXTERN_C
EXPORT_CDECL(void) test_finalizer_rel_size_t_set_errno(size_t i);
EXPORT_CDECL(void) reset_errno();
}
MOZ_END_EXTERN_C

View File

@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jsctypes-test.h"
#include "nsCRTGlue.h"
#include <math.h>
#include <stdarg.h>
#include <stdio.h>

View File

@ -6,14 +6,22 @@
#ifndef jsctypes_test_h
#define jsctypes_test_h
#include "nscore.h"
#include "mozilla/Attributes.h"
#include "mozilla/Types.h"
#include "jspubtd.h"
#define EXPORT_CDECL(type) NS_EXPORT type
#define EXPORT_STDCALL(type) NS_EXPORT type NS_STDCALL
#define EXPORT_CDECL(type) MOZ_EXPORT type
#if defined(_WIN32)
#if defined(_WIN64)
#define NS_STDCALL
#else
#define NS_STDCALL __stdcall
#endif
#define EXPORT_STDCALL(type) MOZ_EXPORT type NS_STDCALL
#endif
MOZ_BEGIN_EXTERN_C
NS_EXTERN_C
{
EXPORT_CDECL(void) test_void_t_cdecl();
EXPORT_CDECL(void*) get_voidptr_t_cdecl();
@ -58,11 +66,11 @@ NS_EXTERN_C
#endif /* defined(_WIN32) */
NS_EXPORT int32_t test_ansi_len(const char*);
NS_EXPORT int32_t test_wide_len(const char16_t*);
NS_EXPORT const char* test_ansi_ret();
NS_EXPORT const char16_t* test_wide_ret();
NS_EXPORT char* test_ansi_echo(const char*);
MOZ_EXPORT int32_t test_ansi_len(const char*);
MOZ_EXPORT int32_t test_wide_len(const char16_t*);
MOZ_EXPORT const char* test_ansi_ret();
MOZ_EXPORT const char16_t* test_wide_ret();
MOZ_EXPORT char* test_ansi_echo(const char*);
struct ONE_BYTE {
char a;
@ -139,31 +147,31 @@ NS_EXTERN_C
int32_t n4;
};
NS_EXPORT int32_t test_pt_in_rect(myRECT, myPOINT);
NS_EXPORT void test_init_pt(myPOINT* pt, int32_t x, int32_t y);
MOZ_EXPORT int32_t test_pt_in_rect(myRECT, myPOINT);
MOZ_EXPORT void test_init_pt(myPOINT* pt, int32_t x, int32_t y);
NS_EXPORT int32_t test_nested_struct(NESTED);
NS_EXPORT myPOINT test_struct_return(myRECT);
NS_EXPORT myRECT test_large_struct_return(myRECT, myRECT);
NS_EXPORT ONE_BYTE test_1_byte_struct_return(myRECT);
NS_EXPORT TWO_BYTE test_2_byte_struct_return(myRECT);
NS_EXPORT THREE_BYTE test_3_byte_struct_return(myRECT);
NS_EXPORT FOUR_BYTE test_4_byte_struct_return(myRECT);
NS_EXPORT FIVE_BYTE test_5_byte_struct_return(myRECT);
NS_EXPORT SIX_BYTE test_6_byte_struct_return(myRECT);
NS_EXPORT SEVEN_BYTE test_7_byte_struct_return(myRECT);
MOZ_EXPORT int32_t test_nested_struct(NESTED);
MOZ_EXPORT myPOINT test_struct_return(myRECT);
MOZ_EXPORT myRECT test_large_struct_return(myRECT, myRECT);
MOZ_EXPORT ONE_BYTE test_1_byte_struct_return(myRECT);
MOZ_EXPORT TWO_BYTE test_2_byte_struct_return(myRECT);
MOZ_EXPORT THREE_BYTE test_3_byte_struct_return(myRECT);
MOZ_EXPORT FOUR_BYTE test_4_byte_struct_return(myRECT);
MOZ_EXPORT FIVE_BYTE test_5_byte_struct_return(myRECT);
MOZ_EXPORT SIX_BYTE test_6_byte_struct_return(myRECT);
MOZ_EXPORT SEVEN_BYTE test_7_byte_struct_return(myRECT);
NS_EXPORT void * test_fnptr();
MOZ_EXPORT void * test_fnptr();
typedef int32_t (* test_func_ptr)(int8_t);
NS_EXPORT int32_t test_closure_cdecl(int8_t, test_func_ptr);
MOZ_EXPORT int32_t test_closure_cdecl(int8_t, test_func_ptr);
#if defined(_WIN32)
typedef int32_t (NS_STDCALL * test_func_ptr_stdcall)(int8_t);
NS_EXPORT int32_t test_closure_stdcall(int8_t, test_func_ptr_stdcall);
MOZ_EXPORT int32_t test_closure_stdcall(int8_t, test_func_ptr_stdcall);
#endif /* defined(_WIN32) */
NS_EXPORT int32_t test_callme(int8_t);
NS_EXPORT void* test_getfn();
MOZ_EXPORT int32_t test_callme(int8_t);
MOZ_EXPORT void* test_getfn();
EXPORT_CDECL(int32_t) test_sum_va_cdecl(uint8_t n, ...);
EXPORT_CDECL(uint8_t) test_count_true_va_cdecl(uint8_t n, ...);
@ -172,7 +180,8 @@ NS_EXTERN_C
uint8_t vec_len,
int32_t* result, ...);
NS_EXPORT extern myRECT data_rect;
}
MOZ_EXPORT extern myRECT data_rect;
MOZ_END_EXTERN_C
#endif

View File

@ -19,7 +19,3 @@ SharedLibrary('jsctypes-test')
LOCAL_INCLUDES += [
'/js/src/ctypes',
]
USE_LIBS += [
'mozalloc',
]