



REM Environment variables:
set TT_MOZ_SRC_DIR=%BUILDDIR%
set TT_PATCH_DIR=E:\Mozilla\tete009_patch\tete\Fx14.0




REM build mozlibpixman.dll:
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\Makefile.in %TT_PATCH_DIR%\libpixman_Makefile.in.patch
xcopy %TT_PATCH_DIR%\mozlibpixman_tt.def %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\ /r /y




REM string:
patch -N %TT_MOZ_SRC_DIR%\xpcom\string\public\nsCharTraits.h %TT_PATCH_DIR%\nsCharTraits.h.patch

REM pl double hashing:
patch -N %TT_MOZ_SRC_DIR%\xpcom\glue\pldhash.cpp %TT_PATCH_DIR%\pldhash.cpp.patch

REM nsDeque::Empty():
patch -N %TT_MOZ_SRC_DIR%\xpcom\glue\nsDeque.cpp %TT_PATCH_DIR%\nsDeque.cpp.patch

REM NS_IsMainThread():
patch -N %TT_MOZ_SRC_DIR%\xpcom\glue\nsThreadUtils.cpp %TT_PATCH_DIR%\nsThreadUtils.cpp.patch




REM SocketConnectContinue:
patch -N %TT_MOZ_SRC_DIR%\nsprpub\pr\src\io\prsocket.c %TT_PATCH_DIR%\prsocket.c.patch

REM PR_GetCurrentThread:
patch -N %TT_MOZ_SRC_DIR%\nsprpub\pr\include\md\_win95.h %TT_PATCH_DIR%\_win95.h.patch




REM avoid optimizer bug with MSVC PGO (Bug 595653):
patch -N %TT_MOZ_SRC_DIR%\js\src\Makefile.in %TT_PATCH_DIR%\js_src_Makefile.in.patch

REM js double hashing:
patch -N %TT_MOZ_SRC_DIR%\js\src\jsdhash.cpp %TT_PATCH_DIR%\jsdhash.cpp.patch

REM hack to avoid bug of PGO:
patch -N %TT_MOZ_SRC_DIR%\js\src\jsinterp.h %TT_PATCH_DIR%\jsinterp.h.patch

REM js_strncpy:
patch -N %TT_MOZ_SRC_DIR%\js\src\jsstr.h %TT_PATCH_DIR%\jsstr.h.patch

REM use function version of floor() under -Oi -arch:SSE2
patch -N %TT_MOZ_SRC_DIR%\js\src\jsmath.cpp %TT_PATCH_DIR%\jsmath.cpp.patch

REM use software prefetch:
patch -N %TT_MOZ_SRC_DIR%\js\src\jsgc.cpp %TT_PATCH_DIR%\jsgc.cpp.patch

REM avoid internal compiler error when applying MSVC PGO:
patch -N %TT_MOZ_SRC_DIR%\js\src\methodjit\Compiler.cpp %TT_PATCH_DIR%\Compiler.cpp.patch

REM avoid the bug of PGO:
patch -N %TT_MOZ_SRC_DIR%\js\src\yarr\YarrInterpreter.cpp %TT_PATCH_DIR%\YarrInterpreter.cpp.patch




REM gklayout:
patch -N %TT_MOZ_SRC_DIR%\layout\style\nsCSSRuleProcessor.cpp %TT_PATCH_DIR%\nsCSSRuleProcessor.cpp.patch

REM avoid the fatal error C1001 of compiler when applying PGO:
patch -N %TT_MOZ_SRC_DIR%\layout\style\nsCSSDataBlock.cpp %TT_PATCH_DIR%\nsCSSDataBlock.cpp.patch

REM avoid crash at the time of printing when applying PGO:
patch -N %TT_MOZ_SRC_DIR%\layout\generic\nsContainerFrame.cpp %TT_PATCH_DIR%\nsContainerFrame.cpp.patch




REM libpixman:
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\pixman-private.h %TT_PATCH_DIR%\pixman-private.h.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\pixman-cpu.c %TT_PATCH_DIR%\pixman-cpu.c.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\pixman-edge.c %TT_PATCH_DIR%\pixman-edge.c.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\pixman-sse2.c %TT_PATCH_DIR%\pixman-sse2.c.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\libpixman\src\pixman-trap.c %TT_PATCH_DIR%\pixman-trap.c.patch




REM brush caches for cairo d2d:
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\cairo\src\cairo-d2d-private.h %TT_PATCH_DIR%\cairo-d2d-private.h.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\cairo\cairo\src\cairo-d2d-surface.cpp %TT_PATCH_DIR%\cairo-d2d-surface.cpp.patch




REM scaled image cache:
patch -N %TT_MOZ_SRC_DIR%\gfx\thebes\gfxContext.h %TT_PATCH_DIR%\gfxContext.h.patch
patch -N %TT_MOZ_SRC_DIR%\layout\base\nsLayoutUtils.cpp %TT_PATCH_DIR%\nsLayoutUtils.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\image\src\imgFrame.cpp %TT_PATCH_DIR%\imgFrame.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\thebes\gfxUtils.cpp %TT_PATCH_DIR%\gfxUtils.cpp.patch

REM NULL pointer check for entry->GetRequest():
patch -N %TT_MOZ_SRC_DIR%\image\src\imgLoader.cpp %TT_PATCH_DIR%\imgLoader.cpp.patch




REM 2D:
patch -N %TT_MOZ_SRC_DIR%\gfx\2d\Makefile.in %TT_PATCH_DIR%\gfx_2d_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\2d\Blur.cpp %TT_PATCH_DIR%\Blur.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\2d\DrawTargetD2D.cpp %TT_PATCH_DIR%\DrawTargetD2D.cpp.patch




REM qcms:
patch -N %TT_MOZ_SRC_DIR%\gfx\qcms\Makefile.in %TT_PATCH_DIR%\qcms_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\gfx\qcms\transform.c %TT_PATCH_DIR%\transform.c.patch




REM content:
patch -N %TT_MOZ_SRC_DIR%\content\base\src\nsContentUtils.cpp %TT_PATCH_DIR%\nsContentUtils.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\content\media\nsAudioStream.cpp %TT_PATCH_DIR%\nsAudioStream.cpp.patch

REM avoid crash when applying PGO:
patch -N %TT_MOZ_SRC_DIR%\content\media\Makefile.in %TT_PATCH_DIR%\content_media_Makefile.in.patch




REM svg:
patch -N %TT_MOZ_SRC_DIR%\content\svg\content\src\Makefile.in %TT_PATCH_DIR%\svg_content_src_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\content\svg\content\src\nsSVGFilters.cpp %TT_PATCH_DIR%\nsSVGFilters.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\layout\svg\base\src\Makefile.in %TT_PATCH_DIR%\svg_base_src_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\layout\svg\base\src\nsSVGMaskFrame.cpp %TT_PATCH_DIR%\nsSVGMaskFrame.cpp.patch




REM canvas:
patch -N %TT_MOZ_SRC_DIR%\content\canvas\src\Makefile.in %TT_PATCH_DIR%\canvas_src_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\content\canvas\src\CanvasUtils.cpp %TT_PATCH_DIR%\CanvasUtils.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\content\canvas\src\CanvasUtils.h %TT_PATCH_DIR%\CanvasUtils.h.patch
patch -N %TT_MOZ_SRC_DIR%\content\canvas\src\nsCanvasRenderingContext2DAzure.cpp %TT_PATCH_DIR%\nsCanvasRenderingContext2DAzure.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\content\canvas\src\nsCanvasRenderingContext2D.cpp %TT_PATCH_DIR%\nsCanvasRenderingContext2D.cpp.patch




REM plug-in:
patch -N %TT_MOZ_SRC_DIR%\dom\plugins\base\nsPluginNativeWindowWin.cpp %TT_PATCH_DIR%\nsPluginNativeWindowWin.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\dom\plugins\base\nsPluginHost.cpp %TT_PATCH_DIR%\nsPluginHost.cpp.patch




REM make NS_ASSERT() the same behavior as official builds:
patch -N %TT_MOZ_SRC_DIR%\toolkit\content\debug.js %TT_PATCH_DIR%\debug.js.patch




REM avoid an error LNK1120 for tete009 builds:
patch -N %TT_MOZ_SRC_DIR%\security\nss\lib\freebl\Makefile %TT_PATCH_DIR%\freebl_Makefile.patch
patch -N %TT_MOZ_SRC_DIR%\security\nss\lib\freebl\manifest.mn %TT_PATCH_DIR%\freebl_manifest.mn.patch




REM apply the patch of bug 526038 to avoid crash:
patch -N %TT_MOZ_SRC_DIR%\image\decoders\icon\win\nsIconChannel.cpp %TT_PATCH_DIR%\nsIconChannel.cpp.patch




REM jemalloc:
patch -N %TT_MOZ_SRC_DIR%\mozglue\build\mozglue.def.in %TT_PATCH_DIR%\mozglue.def.in.patch
patch -N %TT_MOZ_SRC_DIR%\memory\jemalloc\jemalloc.c %TT_PATCH_DIR%\jemalloc.c.patch




REM nsWindow & WinUtils:
patch -N %TT_MOZ_SRC_DIR%\widget\windows\nsWindow.cpp %TT_PATCH_DIR%\nsWindow.cpp.patch
patch -N %TT_MOZ_SRC_DIR%\widget\windows\WinUtils.cpp %TT_PATCH_DIR%\WinUtils.cpp.patch




REM avoid Bug 761900 ? (from header.py.diff by otachan san)
patch -N %TT_MOZ_SRC_DIR%\xpcom\idl-parser\header.py %TT_PATCH_DIR%\header.py.patch




REM set MOZ_UA_BUILDID=20100101:
patch -N %TT_MOZ_SRC_DIR%\browser\branding\aurora\configure.sh %TT_PATCH_DIR%\branding_aurora_configure.sh.patch
patch -N %TT_MOZ_SRC_DIR%\browser\branding\nightly\configure.sh %TT_PATCH_DIR%\branding_nightly_configure.sh.patch




REM installer:
patch -N %TT_MOZ_SRC_DIR%\browser\installer\Makefile.in %TT_PATCH_DIR%\browser_installer_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\browser\installer\package-manifest.in %TT_PATCH_DIR%\browser-package-manifest.in.patch
patch -N %TT_MOZ_SRC_DIR%\..\mail\installer\Makefile.in %TT_PATCH_DIR%\mail_installer_Makefile.in.patch
patch -N %TT_MOZ_SRC_DIR%\..\mail\installer\package-manifest.in %TT_PATCH_DIR%\mail-package-manifest.in.patch




REM patch of Bug 766429:
patch -N %TT_MOZ_SRC_DIR%\layout\svg\base\src\nsSVGUtils.cpp %TT_PATCH_DIR%\nsSVGUtils.cpp.patch




