Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit b808ef7

Browse files
committed
Back out ee100983f921 (bug 895047) for build bustage
CLOSED TREE
1 parent 5582e7b commit b808ef7

8 files changed

Lines changed: 21 additions & 40 deletions

File tree

build/unix/elfhack/Makefile.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ WRAP_LDFLAGS=
1616

1717
include $(topsrcdir)/config/rules.mk
1818

19-
DEFINES += -DELFHACK_BUILD
20-
2119
test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX): %$(DLL_SUFFIX): %.$(OBJ_SUFFIX) elfhack $(filter inject/%,$(CSRCS:.c=.$(OBJ_SUFFIX)))
2220
$(MKSHLIB) $(LDFLAGS) $< -nostartfiles
2321
@echo ===

build/unix/elfhack/inject/Makefile.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,5 @@ $(CSRCS): %.c: ../inject.c
3030

3131
GARBAGE += $(CSRCS)
3232

33-
DEFINES += -DELFHACK_BUILD
34-
3533
CFLAGS := -O2 -fno-stack-protector $(filter -m% -I%,$(CFLAGS))
3634
$(CPU)-noinit.$(OBJ_SUFFIX): DEFINES += -DNOINIT

config/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ GARBAGE += \
128128
ifndef CROSS_COMPILE
129129
ifdef USE_ELF_DYNSTR_GC
130130
elf-dynstr-gc: elf-dynstr-gc.c $(GLOBAL_DEPS) $(call mkdir_deps,$(MDDEPDIR))
131-
$(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) -DELFDYNSTRGC_BUILD -o $@ $< $(LDFLAGS) $(GLIB_LIBS)
131+
$(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) -o $@ $< $(LDFLAGS) $(GLIB_LIBS)
132132
endif
133133
endif
134134

js/public/TypeDecls.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ struct jsid;
5050
typedef ptrdiff_t jsid;
5151
#endif
5252

53-
typedef char16_t jschar;
53+
#ifdef WIN32
54+
typedef wchar_t jschar;
55+
#else
56+
typedef uint16_t jschar;
57+
#endif
5458

5559
namespace JS {
5660

js/src/js-confdefs.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@
1010

1111
#include "js/RequiredDefines.h"
1212

13-
#include "mozilla/Char16.h"
14-
1513
#endif /* js_confdefs_h */

mfbt/Char16.h

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* character literals. C++11's char16_t is a distinct builtin type. C11's
1515
* char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit
1616
* code unit of a Unicode code point, not a "character".
17+
*
18+
* For now, Char16.h only supports C++ because we don't want mix different C
19+
* and C++ definitions of char16_t in the same code base.
1720
*/
1821

1922
#ifdef _MSC_VER
@@ -36,26 +39,10 @@
3639
* typedef from wchar_t.
3740
*/
3841
# define MOZ_CHAR16_IS_NOT_WCHAR
39-
#elif !defined(__cplusplus)
40-
# if defined(WIN32)
41-
# include <yvals.h>
42-
typedef wchar_t char16_t;
43-
# else
44-
/**
45-
* We can't use the stdint.h uint16_t type here because including
46-
* stdint.h will break building some of our C libraries, such as
47-
* sqlite.
48-
*/
49-
typedef unsigned short char16_t;
50-
# endif
5142
#else
5243
# error "Char16.h requires C++11 (or something like it) for UTF-16 support."
5344
#endif
5445

55-
/* This is a temporary hack until bug 927728 is fixed. */
56-
#define __PRUNICHAR__
57-
typedef char16_t PRUnichar;
58-
5946
/*
6047
* Macro arguments used in concatenation or stringification won't be expanded.
6148
* Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to
@@ -66,12 +53,9 @@ typedef char16_t PRUnichar;
6653
*/
6754
#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)
6855

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

7761
#endif /* mozilla_Char16_h */

mozilla-config.h.in

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,6 @@
2525
#define __STDC_FORMAT_MACROS
2626
#endif
2727

28-
/*
29-
* Force-include Char16.h in order to define PRUnichar as char16_t everywhere.
30-
* Note that this should be the first #include to make sure that prtypes.h does
31-
* not attempt to define PRUnichar. This includes the following hunspell-specific
32-
* includes.
33-
*
34-
* We don't use this to build elfhack and elf-dynstr-gc since those builds happen
35-
* during the export tier. Also, disable this when building assembly files too.
36-
*/
37-
#if !defined(ELFHACK_BUILD) && !defined(ELFDYNSTRGC_BUILD) && !defined(__ASSEMBLER__)
38-
#include "mozilla/Char16.h"
39-
#endif
40-
4128
/*
4229
* Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell,
4330
* so that we don't need to modify them directly.

xpcom/base/nscore.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,18 @@ typedef unsigned long nsrefcnt;
325325
typedef uint32_t nsrefcnt;
326326
#endif
327327

328+
/* ------------------------------------------------------------------------ */
329+
/* Casting macros for hiding C++ features from older compilers */
330+
331+
#ifndef __PRUNICHAR__
332+
#define __PRUNICHAR__
333+
#if defined(WIN32)
334+
typedef wchar_t PRUnichar;
335+
#else
336+
typedef uint16_t PRUnichar;
337+
#endif
338+
#endif
339+
328340
/*
329341
* Use these macros to do 64bit safe pointer conversions.
330342
*/

0 commit comments

Comments
 (0)