Skip to content

Commit

Permalink
Back out ee100983f921 (bug 895047) for build bustage
Browse files Browse the repository at this point in the history
CLOSED TREE
  • Loading branch information
philor committed Oct 17, 2013
1 parent 5582e7b commit b808ef7
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 40 deletions.
2 changes: 0 additions & 2 deletions build/unix/elfhack/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ WRAP_LDFLAGS=

include $(topsrcdir)/config/rules.mk

DEFINES += -DELFHACK_BUILD

test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack $(filter inject/%,$(CSRCS:.c=.$(OBJ_SUFFIX)))
$(MKSHLIB) $(LDFLAGS) $< -nostartfiles
@echo ===
Expand Down
2 changes: 0 additions & 2 deletions build/unix/elfhack/inject/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ $(CSRCS): %.c: ../inject.c

GARBAGE += $(CSRCS)

DEFINES += -DELFHACK_BUILD

CFLAGS := -O2 -fno-stack-protector $(filter -m% -I%,$(CFLAGS))
$(CPU)-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT
2 changes: 1 addition & 1 deletion config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ GARBAGE += \
ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
elf-dynstr-gc: elf-dynstr-gc.c $(GLOBAL_DEPS) $(call mkdir_deps,$(MDDEPDIR))
$(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) -DELFDYNSTRGC_BUILD -o $@ $< $(LDFLAGS) $(GLIB_LIBS)
$(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) -o $@ $< $(LDFLAGS) $(GLIB_LIBS)
endif
endif

Expand Down
6 changes: 5 additions & 1 deletion js/public/TypeDecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ struct jsid;
typedef ptrdiff_t jsid;
#endif

typedef char16_t jschar;
#ifdef WIN32
typedef wchar_t jschar;
#else
typedef uint16_t jschar;
#endif

namespace JS {

Expand Down
2 changes: 0 additions & 2 deletions js/src/js-confdefs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

#include "js/RequiredDefines.h"

#include "mozilla/Char16.h"

#endif /* js_confdefs_h */
22 changes: 3 additions & 19 deletions mfbt/Char16.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* character literals. C++11's char16_t is a distinct builtin type. C11's
* char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit
* code unit of a Unicode code point, not a "character".
*
* For now, Char16.h only supports C++ because we don't want mix different C
* and C++ definitions of char16_t in the same code base.
*/

#ifdef _MSC_VER
Expand All @@ -36,26 +39,10 @@
* typedef from wchar_t.
*/
# define MOZ_CHAR16_IS_NOT_WCHAR
#elif !defined(__cplusplus)
# if defined(WIN32)
# include <yvals.h>
typedef wchar_t char16_t;
# else
/**
* We can't use the stdint.h uint16_t type here because including
* stdint.h will break building some of our C libraries, such as
* sqlite.
*/
typedef unsigned short char16_t;
# endif
#else
# error "Char16.h requires C++11 (or something like it) for UTF-16 support."
#endif

/* This is a temporary hack until bug 927728 is fixed. */
#define __PRUNICHAR__
typedef char16_t PRUnichar;

/*
* Macro arguments used in concatenation or stringification won't be expanded.
* Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to
Expand All @@ -66,12 +53,9 @@ typedef char16_t PRUnichar;
*/
#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)

#if defined(__cplusplus) && \
(__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))
static_assert(sizeof(char16_t) == 2, "Is char16_t type 16 bits?");
static_assert(char16_t(-1) > char16_t(0), "Is char16_t type unsigned?");
static_assert(sizeof(MOZ_UTF16('A')) == 2, "Is char literal 16 bits?");
static_assert(sizeof(MOZ_UTF16("")[0]) == 2, "Is string char 16 bits?");
#endif

#endif /* mozilla_Char16_h */
13 changes: 0 additions & 13 deletions mozilla-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@
#define __STDC_FORMAT_MACROS
#endif

/*
* Force-include Char16.h in order to define PRUnichar as char16_t everywhere.
* Note that this should be the first #include to make sure that prtypes.h does
* not attempt to define PRUnichar. This includes the following hunspell-specific
* includes.
*
* We don't use this to build elfhack and elf-dynstr-gc since those builds happen
* during the export tier. Also, disable this when building assembly files too.
*/
#if !defined(ELFHACK_BUILD) && !defined(ELFDYNSTRGC_BUILD) && !defined(__ASSEMBLER__)
#include "mozilla/Char16.h"
#endif

/*
* Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell,
* so that we don't need to modify them directly.
Expand Down
12 changes: 12 additions & 0 deletions xpcom/base/nscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,18 @@ typedef unsigned long nsrefcnt;
typedef uint32_t nsrefcnt;
#endif

/* ------------------------------------------------------------------------ */
/* Casting macros for hiding C++ features from older compilers */

#ifndef __PRUNICHAR__
#define __PRUNICHAR__
#if defined(WIN32)
typedef wchar_t PRUnichar;
#else
typedef uint16_t PRUnichar;
#endif
#endif

/*
* Use these macros to do 64bit safe pointer conversions.
*/
Expand Down

0 comments on commit b808ef7

Please sign in to comment.