Skip to content

Commit

Permalink
Bug 1463637: Remove mozilla-config.h hacks for Hunspell extra include…
Browse files Browse the repository at this point in the history
…s. r=ted

MozReview-Commit-ID: 2yBlykhQsyV

--HG--
extra : rebase_source : d51a663c5f7d4c9cce09c649003c5577fe5952d0
  • Loading branch information
kmaglione committed May 23, 2018
1 parent 9b633c9 commit c4035f1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
10 changes: 10 additions & 0 deletions build/templates.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,15 @@ def NoVisibilityFlags():
def AllowCompilerWarnings():
COMPILE_FLAGS['WARNINGS_AS_ERRORS'] = []

@template
def ForceInclude(*headers):
"""Force includes a set of header files in C++ compilations"""
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
include_flag = '-FI'
else:
include_flag = '-include'
for header in headers:
CXXFLAGS += [include_flag, header]

include('gecko_templates.mozbuild')
include('test_templates.mozbuild')
9 changes: 9 additions & 0 deletions extensions/spellcheck/hunspell/glue/common.mozbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.

@template
def HunspellIncludes():
ForceInclude('hunspell_alloc_hooks.h', 'hunspell_fopen_hooks.h')
3 changes: 0 additions & 3 deletions extensions/spellcheck/hunspell/glue/hunspell_alloc_hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
* reporting to hunspell without modifying its code, in order to ease future
* upgrades.
*
* This file is force-included through mozilla-config.h which is generated
* during the configure step.
*
* Currently, the memory allocated using operator new/new[] is not being
* tracked, but that's OK, since almost all of the memory used by Hunspell is
* allocated using C memory allocation functions.
Expand Down
3 changes: 0 additions & 3 deletions extensions/spellcheck/hunspell/glue/hunspell_fopen_hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
* This file is force-included in hunspell code. Its purpose is to add
* readahead to fopen() calls in hunspell without modifying its code, in order
* to ease future upgrades.
*
* This file is force-included through mozilla-config.h which is generated
* during the configure step.
*/

#include "mozilla/FileUtils.h"
Expand Down
7 changes: 3 additions & 4 deletions extensions/spellcheck/hunspell/glue/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ LOCAL_INCLUDES += [
]

include('/ipc/chromium/chromium-config.mozbuild')
include('common.mozbuild')

HunspellIncludes()

IPDL_SOURCES = [
'PRemoteSpellcheckEngine.ipdl',
Expand All @@ -29,7 +32,3 @@ EXPORTS.mozilla += [
'RemoteSpellCheckEngineChild.h',
'RemoteSpellCheckEngineParent.h',
]

# This variable is referenced in mozilla-config.h.in. Make sure to change
# that file too if you need to change this variable.
DEFINES['HUNSPELL_STATIC'] = True
7 changes: 3 additions & 4 deletions extensions/spellcheck/hunspell/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ UNIFIED_SOURCES += [
'suggestmgr.cxx',
]

# This variable is referenced in mozilla-config.h.in. Make sure to change
# that file too if you need to change this variable.
DEFINES['HUNSPELL_STATIC'] = True

FINAL_LIBRARY = 'xul'

LOCAL_INCLUDES += [
Expand All @@ -29,6 +25,9 @@ LOCAL_INCLUDES += [
AllowCompilerWarnings()

include('/ipc/chromium/chromium-config.mozbuild')
include('../glue/common.mozbuild')

HunspellIncludes()

if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
CXXFLAGS += [
Expand Down
11 changes: 0 additions & 11 deletions mozilla-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@
#pragma clang diagnostic pop
#endif

/*
* Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell,
* so that we don't need to modify them directly.
*
* HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/moz.build
*/
#if defined(HUNSPELL_STATIC)
#include "hunspell_alloc_hooks.h"
#include "hunspell_fopen_hooks.h"
#endif

/*
* Force-include sdkdecls.h for building the chromium sandbox code.
*
Expand Down

0 comments on commit c4035f1

Please sign in to comment.