diff options
author | ryoon <ryoon@pkgsrc.org> | 2013-12-26 13:17:37 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2013-12-26 13:17:37 +0000 |
commit | 7d3956ea94b7f4ed04a8b0f70c119d6d038db8b6 (patch) | |
tree | a315efbcb5ff852c0fe512f8fe9bed8f1a53c125 | |
parent | aed6f2fea2cf689bc8b420b95bf3833e9b69b2c3 (diff) | |
download | pkgsrc-7d3956ea94b7f4ed04a8b0f70c119d6d038db8b6.tar.gz |
Update to 2.23
Changelog:
SeaMonkey-specific changes
Download progress is now shown in the Mac OS X app dock icon.
EXIF orientation is now being used when displaying attached images in MailNews.
"This folder is being processed... to get messages." alerts on active MailNews folders now identify the account or folder.
MailNews notifications have a new look.
See the changes page for a more complete overview.
Mozilla platform changes
All plugins, with the exception of recent Flash plugins, now default to click-to-play.
The password manager now supports script-generated password fields.
Support for H.264 on Linux is now available if the appropriate GStreamer plugins are installed.
Support for MP3 decoding on Windows XP has been added, completing MP3 support across Windows OS versions.
The CSP implementation now supports multiple policies, including the case of both an enforced and Report-Only policy, per the spec.
There is no longer a prompt when websites use appcache.
Support for the CSS image orientation property has been added.
IndexedDB can now be used as an "optimistic" storage area so it does not require any prompts and data is stored in a pool with LRU eviction policy, in short temporary storage.
When displaying a standalone images, the EXIF orientation information contained within the JPEG image is now matched (bug 298619).
Page load times have been improved due to no longer decoding images that are not visible (bug 847223).
Support for the AudioToolbox MP3 backend has been added on Mac OS X (bug 914479).
Fixed several stability issues.
Fixed in SeaMonkey 2.23
MFSA 2013-117 Mis-issued ANSSI/DCSSI certificate
MFSA 2013-116 JPEG information leak
MFSA 2013-115 GetElementIC typed array stubs can be generated outside observed typesets
MFSA 2013-114 Use-after-free in synthetic mouse movement
MFSA 2013-113 Trust settings for built-in roots ignored during EV certificate validation
MFSA 2013-112 Linux clipboard information disclosure though selection paste
MFSA 2013-111 Segmentation violation when replacing ordered list elements
MFSA 2013-110 Potential overflow in JavaScript binary search algorithms
MFSA 2013-109 Use-after-free during Table Editing
MFSA 2013-108 Use-after-free in event listeners
MFSA 2013-107 Sandbox restrictions not applied to nested object elements
MFSA 2013-106 Character encoding cross-origin XSS attack
MFSA 2013-104 Miscellaneous memory safety hazards (rv:26.0 / rv:24.2)
62 files changed, 4121 insertions, 1126 deletions
diff --git a/www/seamonkey/Makefile b/www/seamonkey/Makefile index e07a3b7b6e5..53dfbc1aef9 100644 --- a/www/seamonkey/Makefile +++ b/www/seamonkey/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.111 2013/11/23 02:39:25 ryoon Exp $ +# $NetBSD: Makefile,v 1.112 2013/12/26 13:17:37 ryoon Exp $ DISTNAME= # empty PKGNAME= seamonkey-${SM_VER:S/b/beta/} -SM_VER= 2.22.1 +SM_VER= 2.23 #LIGHTNINGVER= 1.9 CATEGORIES= www #${MASTER_SITE_MOZILLA:=seamonkey/releases/${SM_VER}/source/} @@ -22,6 +22,9 @@ PLIST_SRC+= ${PLIST_SRC_DFLT} USE_LANGUAGES+= c c++ USE_TOOLS+= unzip pax +.include "../../www/firefox/mozilla-common.mk" +.include "options.mk" + CONFIG_GUESS_OVERRIDE+= ldap/sdks/c-sdk/config/autoconf/config.guess CONFIG_SUB_OVERRIDE+= ldap/sdks/c-sdk/config/autoconf/config.sub @@ -37,7 +40,8 @@ ALL_ENV+= MOZILLA_PKG_NAME=seamonkey #BUILD_DEPENDS+= yasm>=1.1.0:../../devel/yasm #.endif -CHECK_PORTABILITY_SKIP=mozilla/js/src/tests/update-test262.sh +CHECK_PORTABILITY_SKIP+=mozilla/js/src/tests/update-test262.sh +CHECK_PORTABILITY_SKIP+=mozilla/security/nss/tests/libpkix/libpkix.sh CHECK_INTERPRETER_SKIP+=lib/seamonkey-sdk/sdk/bin/header.py CHECK_INTERPRETER_SKIP+=lib/seamonkey-sdk/sdk/bin/typelib.py @@ -56,6 +60,7 @@ SUBST_VARS.sys-dic= PREFIX # ${RM} -r ${EXTRACT_DIR.lightning-${LIGHTNINGVER}.source.tar.bz2} pre-configure: + cd ${WRKSRC} && mkdir ${OBJDIR} cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} autoconf cd ${WRKSRC}/mozilla && ${SETENV} ${CONFIGURE_ENV} autoconf cd ${WRKSRC}/mozilla/js/src && ${SETENV} ${CONFIGURE_ENV} autoconf @@ -63,27 +68,21 @@ pre-configure: cd ${WRKSRC}/ldap/sdks/c-sdk && ${SETENV} ${CONFIGURE_ENV} autoconf mkdir ${WRKSRC}/mozilla/js/src/.deps -do-build: -# XXX for some reason it doesn't work unless -j is explicitly specified - cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} -j${MAKE_JOBS:U1} - post-install: # ${TOUCH} ${TOUCH_FLAGS} \ # ${DESTDIR}${PREFIX}/include/seamonkey/mozilla/throw_gcc.h @${STEP_MSG} "Installing bundled seamonkey extensions." - rm -rf ${WRKDIR}/extensions - ${MKDIR} ${WRKDIR}/extensions + rm -rf ${WRKDIR}/${OBJDIR}/extensions + ${MKDIR} ${WRKDIR}/${OBJDIR}/extensions ${RUN} for e in ${XPI_FILES}; do \ subdir=`${UNZIP_CMD} -c "$$e" install.rdf | awk '/^ <em:id>/ {sub(".*<em:id>","");sub("</em:id>.*","");print;exit;}'` && \ - ${MKDIR} "${WRKDIR}/extensions/$$subdir" && \ - cd "${WRKDIR}/extensions/$$subdir" && \ + ${MKDIR} "${WRKDIR}/${OBJDIR}/extensions/$$subdir" && \ + cd "${WRKDIR}/${OBJDIR}/extensions/$$subdir" && \ ${UNZIP_CMD} -aqo $$e; \ done ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/lib/seamonkey/extensions - cd ${WRKDIR}/extensions && pax -rw . \ + cd ${WRKDIR}/${OBJDIR}/extensions && pax -rw . \ ${DESTDIR}${PREFIX}/lib/seamonkey/extensions/. - rm -rf ${WRKDIR}/extensions + rm -rf ${WRKDIR}/${OBJDIR}/extensions -.include "../../www/firefox/mozilla-common.mk" -.include "options.mk" .include "../../mk/bsd.pkg.mk" diff --git a/www/seamonkey/PLIST b/www/seamonkey/PLIST index 2b6d2def1a2..8c099a3a307 100644 --- a/www/seamonkey/PLIST +++ b/www/seamonkey/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.41 2013/11/23 02:39:25 ryoon Exp $ +@comment $NetBSD: PLIST,v 1.42 2013/12/26 13:17:37 ryoon Exp $ bin/seamonkey lib/seamonkey/application.ini lib/seamonkey/blocklist.xml @@ -226,7 +226,8 @@ lib/seamonkey/chrome/classic/skin/classic/messenger/icons/folder-trash-open.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/folder-trash-share-open.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/folder-trash-share.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/folder-trash.png -lib/seamonkey/chrome/classic/skin/classic/messenger/icons/junkBar.png +lib/seamonkey/chrome/classic/skin/classic/messenger/icons/info.png +lib/seamonkey/chrome/classic/skin/classic/messenger/icons/junk.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/junkcol.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/local-mailhost.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/message-mail-attach-del.png @@ -265,6 +266,7 @@ lib/seamonkey/chrome/classic/skin/classic/messenger/icons/message-news.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/messengericons-small.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/messengericons.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/new-mail-alert.png +lib/seamonkey/chrome/classic/skin/classic/messenger/icons/phishing.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/readcol.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/remote-blocked.png lib/seamonkey/chrome/classic/skin/classic/messenger/icons/server-local-new.png @@ -1069,6 +1071,7 @@ lib/seamonkey/chrome/en-US/locale/en-US/global-region/region.properties lib/seamonkey/chrome/en-US/locale/en-US/global/AccessFu.properties lib/seamonkey/chrome/en-US/locale/en-US/global/about.dtd lib/seamonkey/chrome/en-US/locale/en-US/global/aboutAbout.dtd +lib/seamonkey/chrome/en-US/locale/en-US/global/aboutNetworking.dtd lib/seamonkey/chrome/en-US/locale/en-US/global/aboutRights.dtd lib/seamonkey/chrome/en-US/locale/en-US/global/aboutSupport.dtd lib/seamonkey/chrome/en-US/locale/en-US/global/aboutSupport.properties @@ -1674,7 +1677,6 @@ lib/seamonkey/chrome/pippki/content/pippki/downloadcert.xul lib/seamonkey/chrome/pippki/content/pippki/editcacert.xul lib/seamonkey/chrome/pippki/content/pippki/editcerts.js lib/seamonkey/chrome/pippki/content/pippki/editemailcert.xul -lib/seamonkey/chrome/pippki/content/pippki/editsslcert.xul lib/seamonkey/chrome/pippki/content/pippki/escrowWarn.js lib/seamonkey/chrome/pippki/content/pippki/escrowWarn.xul lib/seamonkey/chrome/pippki/content/pippki/exceptionDialog.js @@ -1707,9 +1709,12 @@ lib/seamonkey/chrome/toolkit/content/global/BrowserElementPanning.js lib/seamonkey/chrome/toolkit/content/global/XPCNativeWrapper.js lib/seamonkey/chrome/toolkit/content/global/about.xhtml lib/seamonkey/chrome/toolkit/content/global/aboutAbout.xhtml +lib/seamonkey/chrome/toolkit/content/global/aboutCompartments.xhtml lib/seamonkey/chrome/toolkit/content/global/aboutMemory.css lib/seamonkey/chrome/toolkit/content/global/aboutMemory.js lib/seamonkey/chrome/toolkit/content/global/aboutMemory.xhtml +lib/seamonkey/chrome/toolkit/content/global/aboutNetworking.js +lib/seamonkey/chrome/toolkit/content/global/aboutNetworking.xhtml lib/seamonkey/chrome/toolkit/content/global/aboutRights-unbranded.xhtml lib/seamonkey/chrome/toolkit/content/global/aboutRights.xhtml lib/seamonkey/chrome/toolkit/content/global/aboutSupport.js @@ -1719,6 +1724,7 @@ lib/seamonkey/chrome/toolkit/content/global/aboutTelemetry.js lib/seamonkey/chrome/toolkit/content/global/aboutTelemetry.xhtml lib/seamonkey/chrome/toolkit/content/global/accessibility/AccessFu.css lib/seamonkey/chrome/toolkit/content/global/accessibility/content-script.js +lib/seamonkey/chrome/toolkit/content/global/accessibility/tick.wav lib/seamonkey/chrome/toolkit/content/global/alerts/alert.css lib/seamonkey/chrome/toolkit/content/global/alerts/alert.js lib/seamonkey/chrome/toolkit/content/global/alerts/alert.xul @@ -1829,6 +1835,7 @@ lib/seamonkey/chrome/toolkit/content/global/resetProfile.css lib/seamonkey/chrome/toolkit/content/global/resetProfile.js lib/seamonkey/chrome/toolkit/content/global/resetProfile.xul lib/seamonkey/chrome/toolkit/content/global/resetProfileProgress.xul +lib/seamonkey/chrome/toolkit/content/global/select-child.js lib/seamonkey/chrome/toolkit/content/global/selectDialog.js lib/seamonkey/chrome/toolkit/content/global/selectDialog.xul lib/seamonkey/chrome/toolkit/content/global/strres.js @@ -2135,6 +2142,7 @@ lib/seamonkey/chrome/toolkit/skin/classic/help/Weblink-rtl.png lib/seamonkey/chrome/toolkit/skin/classic/help/Weblink.png lib/seamonkey/chrome/toolkit/skin/classic/help/help.css lib/seamonkey/chrome/toolkit/skin/classic/help/helpFileLayout.css +lib/seamonkey/chrome/toolkit/skin/classic/mozapps/aboutNetworking.css lib/seamonkey/chrome/toolkit/skin/classic/mozapps/downloads/downloadButtons.png lib/seamonkey/chrome/toolkit/skin/classic/mozapps/downloads/downloadIcon.png lib/seamonkey/chrome/toolkit/skin/classic/mozapps/downloads/downloads.css @@ -2222,9 +2230,11 @@ lib/seamonkey/components/FeedWriter.js lib/seamonkey/components/FormHistoryStartup.js lib/seamonkey/components/NetworkGeolocationProvider.js lib/seamonkey/components/PermissionSettings.js +lib/seamonkey/components/PhoneNumberService.js lib/seamonkey/components/PlacesCategoriesStarter.js lib/seamonkey/components/SettingsManager.js lib/seamonkey/components/SiteSpecificUserAgent.js +lib/seamonkey/components/SuiteProfileMigrator.js lib/seamonkey/components/TCPSocket.js lib/seamonkey/components/TCPSocketParentIntermediary.js lib/seamonkey/components/TelemetryPing.js @@ -2293,8 +2303,6 @@ lib/seamonkey/components/nsSuiteGlue.js lib/seamonkey/components/nsTaggingService.js lib/seamonkey/components/nsTypeAheadFind.js lib/seamonkey/components/nsURLFormatter.js -lib/seamonkey/components/nsUpdateService.js -lib/seamonkey/components/nsUpdateServiceStub.js lib/seamonkey/components/nsUpdateTimerManager.js lib/seamonkey/components/nsUrlClassifierHashCompleter.js lib/seamonkey/components/nsUrlClassifierLib.js @@ -2766,6 +2774,8 @@ lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/mes lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/folder-trash-share-open.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/folder-trash-share.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/folder-trash.gif +lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/info.png +lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/junk.png lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/junkBar.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/local-mailhost.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/mast-mail.gif @@ -2804,6 +2814,7 @@ lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/mes lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/message-news-offl.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/message-news.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/new-mail-alert.png +lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/phishing.png lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/readcol-read.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/readcol-unread.gif lib/seamonkey/extensions/modern@themes.mozilla.org/chrome/modern/skin/modern/messenger/icons/remote-blocked.png @@ -3008,7 +3019,6 @@ lib/seamonkey/hyphenation/hyph_sl.dic lib/seamonkey/hyphenation/hyph_sv.dic lib/seamonkey/hyphenation/hyph_tr.dic lib/seamonkey/hyphenation/hyph_uk.dic -lib/seamonkey/icons/updater.png lib/seamonkey/isp/Bogofilter.sfd lib/seamonkey/isp/DSPAM.sfd lib/seamonkey/isp/POPFile.sfd @@ -3035,6 +3045,7 @@ lib/seamonkey/modules/AlarmService.jsm lib/seamonkey/modules/AppDownloadManager.jsm lib/seamonkey/modules/AppsServiceChild.jsm lib/seamonkey/modules/AppsUtils.jsm +lib/seamonkey/modules/AsyncShutdown.jsm lib/seamonkey/modules/AsyncSpellCheckTestHelper.jsm lib/seamonkey/modules/BookmarkHTMLUtils.jsm lib/seamonkey/modules/BookmarkJSONUtils.jsm @@ -3060,12 +3071,12 @@ lib/seamonkey/modules/DeferredTask.jsm lib/seamonkey/modules/Deprecated.jsm lib/seamonkey/modules/Dict.jsm lib/seamonkey/modules/DownloadCore.jsm +lib/seamonkey/modules/DownloadImport.jsm lib/seamonkey/modules/DownloadIntegration.jsm lib/seamonkey/modules/DownloadLastDir.jsm lib/seamonkey/modules/DownloadList.jsm lib/seamonkey/modules/DownloadPaths.jsm lib/seamonkey/modules/DownloadStore.jsm -lib/seamonkey/modules/DownloadTaskbarIntegration.jsm lib/seamonkey/modules/DownloadTaskbarProgress.jsm lib/seamonkey/modules/DownloadUIHelper.jsm lib/seamonkey/modules/DownloadUtils.jsm @@ -3074,6 +3085,7 @@ lib/seamonkey/modules/FileUtils.jsm lib/seamonkey/modules/ForgetAboutSite.jsm lib/seamonkey/modules/FormHistory.jsm lib/seamonkey/modules/FrameWorker.jsm +lib/seamonkey/modules/FrameWorkerContent.js lib/seamonkey/modules/FreeSpaceWatcher.jsm lib/seamonkey/modules/Geometry.jsm lib/seamonkey/modules/Http.jsm @@ -3081,7 +3093,9 @@ lib/seamonkey/modules/IOUtils.js lib/seamonkey/modules/ISO8601DateUtils.jsm lib/seamonkey/modules/IndexedDBHelper.jsm lib/seamonkey/modules/InlineSpellChecker.jsm +lib/seamonkey/modules/InsecurePasswordUtils.jsm lib/seamonkey/modules/JXON.js +lib/seamonkey/modules/Keyboard.jsm lib/seamonkey/modules/LightweightThemeConsumer.jsm lib/seamonkey/modules/LightweightThemeImageOptimizer.jsm lib/seamonkey/modules/LightweightThemeManager.jsm @@ -3095,6 +3109,7 @@ lib/seamonkey/modules/NetUtil.jsm lib/seamonkey/modules/NewTabUtils.jsm lib/seamonkey/modules/ObjectWrapper.jsm lib/seamonkey/modules/OfflineCacheInstaller.jsm +lib/seamonkey/modules/OperatorApps.jsm lib/seamonkey/modules/PageMenu.jsm lib/seamonkey/modules/PageThumbs.jsm lib/seamonkey/modules/PageThumbsWorker.js @@ -3105,6 +3120,7 @@ lib/seamonkey/modules/PermissionsInstaller.jsm lib/seamonkey/modules/PermissionsTable.jsm lib/seamonkey/modules/PhoneNumber.jsm lib/seamonkey/modules/PhoneNumberMetaData.jsm +lib/seamonkey/modules/PhoneNumberNormalizer.jsm lib/seamonkey/modules/PhoneNumberUtils.jsm lib/seamonkey/modules/PlacesBackups.jsm lib/seamonkey/modules/PlacesDBUtils.jsm @@ -3118,21 +3134,29 @@ lib/seamonkey/modules/PrivateBrowsingUtils.jsm lib/seamonkey/modules/Promise.jsm lib/seamonkey/modules/PropertyListUtils.jsm lib/seamonkey/modules/PushService.jsm +lib/seamonkey/modules/RemoteAddonsChild.jsm +lib/seamonkey/modules/RemoteAddonsParent.jsm +lib/seamonkey/modules/RemoteController.jsm lib/seamonkey/modules/RemoteSecurityUI.jsm +lib/seamonkey/modules/RemoteWebNavigation.jsm lib/seamonkey/modules/RemoteWebProgress.jsm lib/seamonkey/modules/ResetProfile.jsm lib/seamonkey/modules/SafeBrowsing.jsm lib/seamonkey/modules/Sanitizer.jsm +lib/seamonkey/modules/SelectContentHelper.jsm +lib/seamonkey/modules/SelectParentHelper.jsm lib/seamonkey/modules/Services.jsm lib/seamonkey/modules/SettingsChangeNotifier.jsm lib/seamonkey/modules/SettingsDB.jsm lib/seamonkey/modules/SettingsQueue.jsm +lib/seamonkey/modules/Sntp.jsm lib/seamonkey/modules/SocialService.jsm lib/seamonkey/modules/SpellCheckDictionaryBootstrap.js lib/seamonkey/modules/Sqlite.jsm lib/seamonkey/modules/StringBundle.js lib/seamonkey/modules/SystemMessagePermissionsChecker.jsm lib/seamonkey/modules/Task.jsm +lib/seamonkey/modules/TelemetryFile.jsm lib/seamonkey/modules/TelemetryStopwatch.jsm lib/seamonkey/modules/TelemetryTimestamps.jsm lib/seamonkey/modules/ThirdPartyCookieProbe.jsm @@ -3140,6 +3164,7 @@ lib/seamonkey/modules/Timer.jsm lib/seamonkey/modules/Troubleshoot.jsm lib/seamonkey/modules/UpdateChannel.jsm lib/seamonkey/modules/UserAgentOverrides.jsm +lib/seamonkey/modules/UserAgentUpdates.jsm lib/seamonkey/modules/WebappOSUtils.jsm lib/seamonkey/modules/Webapps.jsm lib/seamonkey/modules/WebappsInstaller.jsm @@ -3254,6 +3279,7 @@ lib/seamonkey/modules/commonjs/sdk/passwords.js lib/seamonkey/modules/commonjs/sdk/passwords/utils.js lib/seamonkey/modules/commonjs/sdk/places/bookmarks.js lib/seamonkey/modules/commonjs/sdk/places/contract.js +lib/seamonkey/modules/commonjs/sdk/places/events.js lib/seamonkey/modules/commonjs/sdk/places/favicon.js lib/seamonkey/modules/commonjs/sdk/places/history.js lib/seamonkey/modules/commonjs/sdk/places/host/host-bookmarks.js @@ -3304,6 +3330,16 @@ lib/seamonkey/modules/commonjs/sdk/test/runner.js lib/seamonkey/modules/commonjs/sdk/test/tmp-file.js lib/seamonkey/modules/commonjs/sdk/test/utils.js lib/seamonkey/modules/commonjs/sdk/timers.js +lib/seamonkey/modules/commonjs/sdk/ui.js +lib/seamonkey/modules/commonjs/sdk/ui/button.js +lib/seamonkey/modules/commonjs/sdk/ui/button/view.js +lib/seamonkey/modules/commonjs/sdk/ui/sidebar.js +lib/seamonkey/modules/commonjs/sdk/ui/sidebar/actions.js +lib/seamonkey/modules/commonjs/sdk/ui/sidebar/contract.js +lib/seamonkey/modules/commonjs/sdk/ui/sidebar/namespace.js +lib/seamonkey/modules/commonjs/sdk/ui/sidebar/utils.js +lib/seamonkey/modules/commonjs/sdk/ui/sidebar/view.js +lib/seamonkey/modules/commonjs/sdk/ui/state.js lib/seamonkey/modules/commonjs/sdk/url.js lib/seamonkey/modules/commonjs/sdk/url/utils.js lib/seamonkey/modules/commonjs/sdk/util/array.js @@ -3339,14 +3375,23 @@ lib/seamonkey/modules/debug.js lib/seamonkey/modules/devtools/Console.jsm lib/seamonkey/modules/devtools/DevToolsUtils.js lib/seamonkey/modules/devtools/DevToolsUtils.jsm +lib/seamonkey/modules/devtools/Devices.jsm +lib/seamonkey/modules/devtools/LayoutHelpers.jsm lib/seamonkey/modules/devtools/Loader.jsm lib/seamonkey/modules/devtools/Require.jsm +lib/seamonkey/modules/devtools/Simulator.jsm lib/seamonkey/modules/devtools/SourceMap.jsm lib/seamonkey/modules/devtools/Templater.jsm +lib/seamonkey/modules/devtools/app-actor-front.js +lib/seamonkey/modules/devtools/client/connection-manager.js lib/seamonkey/modules/devtools/dbg-client.jsm lib/seamonkey/modules/devtools/dbg-server.jsm +lib/seamonkey/modules/devtools/escodegen/escodegen.js +lib/seamonkey/modules/devtools/escodegen/estraverse.js +lib/seamonkey/modules/devtools/escodegen/package.json.js lib/seamonkey/modules/devtools/gcli.jsm lib/seamonkey/modules/devtools/server/actors/childtab.js +lib/seamonkey/modules/devtools/server/actors/device.js lib/seamonkey/modules/devtools/server/actors/gcli.js lib/seamonkey/modules/devtools/server/actors/inspector.js lib/seamonkey/modules/devtools/server/actors/profiler.js @@ -3354,6 +3399,7 @@ lib/seamonkey/modules/devtools/server/actors/root.js lib/seamonkey/modules/devtools/server/actors/script.js lib/seamonkey/modules/devtools/server/actors/string.js lib/seamonkey/modules/devtools/server/actors/styleeditor.js +lib/seamonkey/modules/devtools/server/actors/styles.js lib/seamonkey/modules/devtools/server/actors/tracer.js lib/seamonkey/modules/devtools/server/actors/webapps.js lib/seamonkey/modules/devtools/server/actors/webbrowser.js @@ -3362,9 +3408,11 @@ lib/seamonkey/modules/devtools/server/child.js lib/seamonkey/modules/devtools/server/main.js lib/seamonkey/modules/devtools/server/protocol.js lib/seamonkey/modules/devtools/server/transport.js +lib/seamonkey/modules/devtools/styleinspector/css-logic.js lib/seamonkey/modules/devtools/toolkit/webconsole/client.js lib/seamonkey/modules/devtools/toolkit/webconsole/network-helper.js lib/seamonkey/modules/devtools/toolkit/webconsole/utils.js +lib/seamonkey/modules/devtools/touch-events.js lib/seamonkey/modules/editorUtilities.jsm lib/seamonkey/modules/errUtils.js lib/seamonkey/modules/folderUtils.jsm @@ -3444,7 +3492,6 @@ lib/seamonkey/modules/services-sync/addonutils.js lib/seamonkey/modules/services-sync/constants.js lib/seamonkey/modules/services-sync/engines.js lib/seamonkey/modules/services-sync/engines/addons.js -lib/seamonkey/modules/services-sync/engines/apps.js lib/seamonkey/modules/services-sync/engines/bookmarks.js lib/seamonkey/modules/services-sync/engines/clients.js lib/seamonkey/modules/services-sync/engines/forms.js @@ -3526,7 +3573,3 @@ lib/seamonkey/searchplugins/creativecommons.xml lib/seamonkey/searchplugins/google.xml lib/seamonkey/searchplugins/wikipedia.xml lib/seamonkey/searchplugins/yahoo.xml -lib/seamonkey/update-settings.ini -lib/seamonkey/update.locale -lib/seamonkey/updater -lib/seamonkey/updater.ini diff --git a/www/seamonkey/PLIST.enigmail b/www/seamonkey/PLIST.enigmail index d796ac70e01..2d69d9dbc7c 100644 --- a/www/seamonkey/PLIST.enigmail +++ b/www/seamonkey/PLIST.enigmail @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST.enigmail,v 1.9 2013/11/23 02:39:25 ryoon Exp $ +@comment $NetBSD: PLIST.enigmail,v 1.10 2013/12/26 13:17:37 ryoon Exp $ lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/chrome.manifest lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/chrome/enigmail.jar lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/components/enigMsgCompFields.js @@ -12,6 +12,7 @@ lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/install.rdf lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/commonFuncs.jsm lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/enigmailCommon.jsm lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/gpgAgentHandler.jsm +lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/installGnuPG.jsm lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/keyManagement.jsm lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/mimeVerify.jsm lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/pipeConsole.jsm @@ -19,3 +20,4 @@ lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/subproce lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/subprocess_worker_unix.js lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/modules/subprocess_worker_win.js lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/platform/${OPSYS}_${TARGET_XPCOM_ABI}/lib/libsubprocess-${TARGET_XPCOM_ABI}.so +lib/seamonkey/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/wrappers/gpg-agent-wrapper.sh diff --git a/www/seamonkey/PLIST.lightning b/www/seamonkey/PLIST.lightning index 276b9c080ec..400a29d21da 100644 --- a/www/seamonkey/PLIST.lightning +++ b/www/seamonkey/PLIST.lightning @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST.lightning,v 1.14 2013/11/23 02:39:25 ryoon Exp $ +@comment $NetBSD: PLIST.lightning,v 1.15 2013/12/26 13:17:37 ryoon Exp $ lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome.manifest lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-provider-en-US/locale/en-US/gdata.dtd lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-provider-en-US/locale/en-US/gdata.properties @@ -11,6 +11,7 @@ lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-pro lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-provider/content/gdata-migration.js lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-provider/skin/gdata-event-dialog-reminder.css lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/chrome/gdata-provider/skin/reminder-action-sms.png +lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/components/.mkdir.done lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/components/calGoogleCalendarModule.js lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/components/calGoogleCalendarModule.manifest lib/seamonkey/extensions/{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}/components/gdata.xpt @@ -283,6 +284,7 @@ lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome/lightning lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome/lightning/skin/lightning/lightning.css lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome/lightning/skin/lightning/mode-switch-icons.png lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome/lightning/skin/lightning/suite-accountCentral.css +lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/.mkdir.done lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calBackendLoader.js lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calBackendLoader.manifest lib/seamonkey/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/calCompositeCalendar.js diff --git a/www/seamonkey/distinfo b/www/seamonkey/distinfo index 84d32aeb8a0..53ed782afec 100644 --- a/www/seamonkey/distinfo +++ b/www/seamonkey/distinfo @@ -1,24 +1,27 @@ -$NetBSD: distinfo,v 1.107 2013/11/23 02:39:25 ryoon Exp $ +$NetBSD: distinfo,v 1.108 2013/12/26 13:17:37 ryoon Exp $ SHA1 (enigmail-1.6.tar.gz) = 51a7eb7d86ce24d8199f741a0079f0d56ecd6368 RMD160 (enigmail-1.6.tar.gz) = a854bb37a6a7f298f6cc268110dcb21d00909fa4 Size (enigmail-1.6.tar.gz) = 1231111 bytes -SHA1 (seamonkey-2.22.1.source.tar.bz2) = 20d661a675b7f812bc8172a5e37f1f8f83896e0f -RMD160 (seamonkey-2.22.1.source.tar.bz2) = d1cc946eba801a0d2129bf77e54ed8a15af3c286 -Size (seamonkey-2.22.1.source.tar.bz2) = 148035166 bytes -SHA1 (patch-aa) = d2582a11a50a94bca98434f5af228a0bb65a633a +SHA1 (seamonkey-2.23.source.tar.bz2) = 3bc97d6f97987925a1ae30fdcc8ef4a4c2606bc2 +RMD160 (seamonkey-2.23.source.tar.bz2) = 1e12add289b122c62a0f29ea1b965ed5578cca2a +Size (seamonkey-2.23.source.tar.bz2) = 148268011 bytes +SHA1 (patch-aa) = f6ec49ef5293672d3b5102ca8a0de35d6809e07b SHA1 (patch-ak) = a36dd36a037a76a40955316200b1f4603b9ed8e9 SHA1 (patch-al) = 06ddb5f0f55ca02bee0d55ddb5316ddd9099f2d9 SHA1 (patch-ao) = f1d598ebb88cd719c8ed34c64f96abca8a19d85e -SHA1 (patch-as) = d9be0c3720e4fd5446d81145df781583f0138739 +SHA1 (patch-as) = 3a06af86d91aa7ad4085de29fcd802fc64a89d7f SHA1 (patch-bf) = cf7fef695c6db66a3653d3258a2385c6f1eb709e SHA1 (patch-bg) = 9aba8618a4f0777527c6e7af33cb234cb0627501 SHA1 (patch-bi) = 904ec1a966d6224f873836d8cbee2eb80eb2d2a9 -SHA1 (patch-config_baseconfig.mk) = 3fdb27d227ef0d858b56023b9c709117d5cc5e00 +SHA1 (patch-config_baseconfig.mk) = e6f3cfe0f8aafcf5bc48d691a05d2d450fdba4ae +SHA1 (patch-config_config.mk) = c99b04603be0091a82409811c3cca8301d21923b SHA1 (patch-ldap_sdks_c-sdk_build.mk) = 541604f0f63f5c1b3ce5509260517f68f417eb73 SHA1 (patch-ldap_sdks_c-sdk_ldap_include_portable.h) = 4ce9e1a0e8f0d05367243e8d2b5118606a35da94 -SHA1 (patch-mail_app_Makefile.in) = d66563480442a43e70715ecabf54ffeda5e5cf79 +SHA1 (patch-mail_app_Makefile.in) = 3d85f5b9ba0af52732f05c30a77cf03593ec0f8e SHA1 (patch-mailnews_base_search_src_nsMsgSearchTerm.cpp) = 0cbabcf5b188e86404e3ded8452c73a7f498efe3 +SHA1 (patch-mailnews_extensions_enigmail_ipc_modules_subprocess.jsm) = 18e3cc5ff4ba287b669e1720767bad1750701d37 +SHA1 (patch-mailnews_extensions_enigmail_ipc_src_Makefile.enig) = d91e90a8fd1b7f2505bd18ffa9d1aae66d9c1614 SHA1 (patch-mb) = f153b28aeb71a0ace4a4c1d55c3e31648d242bd5 SHA1 (patch-mozilla_browser_app_profile_firefox.js) = 2e8d8470d239b6be2c6c64a8a752f8229d421dc6 SHA1 (patch-mozilla_browser_installer_package-manifest.in) = a61eec2dc12b341bfd84bdda0d70842a627e9c9a @@ -26,12 +29,10 @@ SHA1 (patch-mozilla_browser_locales_en-US_chrome_browser-region_region.propertie SHA1 (patch-mozilla_browser_locales_en-US_searchplugins_duckduckgo.xml) = 828def5acc7c9dc18727a27b0c47e44d87a94eaf SHA1 (patch-mozilla_browser_locales_en-US_searchplugins_list.txt) = b1e4c051977fa8fc46bba6afcdbe4e3de778be75 SHA1 (patch-mozilla_build_autoconf_nss.m4) = 3b05127e72a76ac2f87c8362cbde13ce76485a19 -SHA1 (patch-mozilla_config_Makefile.in) = 88906ecbe21393239965d9dfcc4975be6e2ed071 -SHA1 (patch-mozilla_config_baseconfig.mk) = d6f27cdc853e6d026c151bf40cb898428c37455c -SHA1 (patch-mozilla_config_stl-headers) = a0ff5cba5074d84e49d09eb3cc11cf9ef04db852 +SHA1 (patch-mozilla_config_baseconfig.mk) = beaa3691cef5adcc67fd96e8f199ba896fefadce SHA1 (patch-mozilla_config_stl__wrappers_ios) = 066a9f3db9203afa8131b2ff91d212033e5950e0 SHA1 (patch-mozilla_config_stl__wrappers_ostream) = 67559c5ab17088680b86dea6b081a48b781f59b5 -SHA1 (patch-mozilla_config_system-headers) = bc44741903e57169a2e3c2675a6e4f15c72e42d2 +SHA1 (patch-mozilla_config_system-headers) = 482ca62e715eb77b2bc636dafe4492caa188129c SHA1 (patch-mozilla_config_system__wrappers_unwind.h) = e9a5a86146cffef99ab306ff3d3059649801c0ab SHA1 (patch-mozilla_dom_plugins_ipc_PluginModuleChild.cpp) = 400a5af9988d4392d92e493c73bbe61cd1915edb SHA1 (patch-mozilla_dom_plugins_ipc_PluginModuleChild.h) = 14038ce0ee2b38db6c7952056a97a65839a2c1a9 @@ -47,8 +48,8 @@ SHA1 (patch-mozilla_ipc_chromium_Makefile.in) = 076293610dc66961d8179863b056eb66 SHA1 (patch-mozilla_ipc_chromium_chromium-config.mk) = 7908071f6465cb17fe5fba517b0d628bb437f9e3 SHA1 (patch-mozilla_ipc_chromium_src_base_base__paths.h) = 87e8a5b3e859bba908d985d6952bf1a7ca1f60b2 SHA1 (patch-mozilla_ipc_chromium_src_base_debug__util__posix.cc) = b7fb6d1e607e1b00fe3cdde1376fb18e783fa801 -SHA1 (patch-mozilla_ipc_chromium_src_base_file__util.h) = d6ba7a0876840306148c29041f352bee850255cc -SHA1 (patch-mozilla_ipc_chromium_src_base_file__util__posix.cc) = 0d43d6a5de73f88c159dd4caf372be7544aa7c6e +SHA1 (patch-mozilla_ipc_chromium_src_base_file__util.h) = 384cf596d292b4a02bd9d9c51e9f4fc96c4fc200 +SHA1 (patch-mozilla_ipc_chromium_src_base_file__util__posix.cc) = 5bda4f8e05ccc3482158c79094f9fc2bf291a0ce SHA1 (patch-mozilla_ipc_chromium_src_base_file__version__info.h) = 463e8d0c433618fe3750627be88d95d8ac4b7def SHA1 (patch-mozilla_ipc_chromium_src_base_message__pump__libevent.cc) = 7c18b292b688f4185c9012ba03135ab95e5c473b SHA1 (patch-mozilla_ipc_chromium_src_base_platform__thread.h) = 487468d70d9644e6b09c548ab607310ff54add84 @@ -62,72 +63,54 @@ SHA1 (patch-mozilla_ipc_chromium_src_chrome_common_transport__dib.h) = 53c37deda SHA1 (patch-mozilla_ipc_glue_AsyncChannel.cpp) = 8a93fe19a4badf0bf62bffb62a17d1a118625d50 SHA1 (patch-mozilla_ipc_glue_GeckoChildProcessHost.cpp) = eeff8f44c9b781f006f6e9a90c36c2e43cfdf54b SHA1 (patch-mozilla_ipc_ipdl_ipdl_lower.py) = 2bf473a505692adc68c9cdc75a23d53d61c0fc8b -SHA1 (patch-mozilla_js_src_Makefile.in) = 9679856fb0e7ff29227fa15d60812ddfccc7fa9c -SHA1 (patch-mozilla_js_src_config_Makefile.in) = e85ebe41a6c6e68a7cb5ef3a975cb30082010e7c -SHA1 (patch-mozilla_js_src_config_system-headers) = 5477897124d1418ebb1ea73e62bf0dda14e01623 +SHA1 (patch-mozilla_js_src_Makefile.in) = 7b204bdced39d850614e27d458be3ec142ab57d0 +SHA1 (patch-mozilla_js_src_config_system-headers) = 3d882e3ed1b2a76882cade0b190cc896c2384eaf SHA1 (patch-mozilla_js_src_ctypes_CTypes.h) = 3cbc360db82af7f40161d22f4e04c8a720811c3a SHA1 (patch-mozilla_js_src_frontend_ParseMaps.cpp) = af9c153c78a3d50e926f7820db3c98b7fe1db063 -SHA1 (patch-mozilla_js_src_gdb_Makefile.in) = 324bd666c020295d654d4eb07fa7d4f566fdb1c0 SHA1 (patch-mozilla_js_src_jit_AsmJSSignalHandlers.cpp) = 42eae6278a1d34607552c81474c0ece7d3c66b50 -SHA1 (patch-mozilla_js_src_jsapi-tests_Makefile.in) = 5a0eb03ee1835ebf7ccdc5cc15bb623d0abf663e SHA1 (patch-mozilla_js_src_jscompartment.h) = dbe4cec8f27f9e694a73232638a834dfad53431f SHA1 (patch-mozilla_js_src_jsmath.cpp) = 25225d4b9f05766314dfb7a809e8f4cf7ffa1f4b -SHA1 (patch-mozilla_js_src_shell_Makefile.in) = baf021d7fe8de763205949b6ffd85abcd8dcdcb8 -SHA1 (patch-mozilla_js_src_vm_ObjectImpl-inl.h) = 6389aa919cb3c414ba380760030cd4ccaf100704 -SHA1 (patch-mozilla_js_src_vm_SPSProfiler.cpp) = e59ef5e6cb02d9466b90998fe9ec0c2575b09738 +SHA1 (patch-mozilla_js_src_vm_SPSProfiler.cpp) = c1579080ef9ad56ad9780ad5bb7278a0f778087b SHA1 (patch-mozilla_media_libcubeb_src_cubeb__alsa.c) = b4a9115230383158f45b5bf7005130a8d320fd56 SHA1 (patch-mozilla_media_libpng_pngpriv.h) = 43f554286be3ed7916c065d89fbf59764e5c7bbe SHA1 (patch-mozilla_media_libsoundtouch_src_cpu__detect__x86.cpp) = 83dcc1ffc6ffdd92b5c44f35875b107e46348916 -SHA1 (patch-mozilla_media_mtransport_objs.mk) = c14ca9e5f727311495d74107282b0452144a1537 -SHA1 (patch-mozilla_media_mtransport_test_Makefile.in) = 2f6341529a79596ffcfcdb96275b243d1a700356 -SHA1 (patch-mozilla_media_mtransport_third__party_nICEr_nicer.gyp) = 41eca45bba8612b9c995b5a8e29ccda3ef06735b -SHA1 (patch-mozilla_media_mtransport_third__party_nICEr_src_stun_addrs.c) = 2a58e499393caa8c105bd64c5b7e1061a1cfa87d -SHA1 (patch-mozilla_media_mtransport_third__party_nICEr_src_stun_stun.h) = ddbc02a8529086ddc1dc0b99664cc829f27700c4 -SHA1 (patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c) = 73fc5b93224b5e48853d4412f8c2e0b8ee50238e -SHA1 (patch-mozilla_media_mtransport_third__party_nrappkit_nrappkit.gyp) = d7109ef00d55d910d04cba98ff55ad639da28b9a -SHA1 (patch-mozilla_media_mtransport_third__party_nrappkit_src_log_r__log.c) = 8c94e88fc49624041d799341fb2111e072e4f6a7 -SHA1 (patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h) = bdc146627d56abfb6ff9e083a48ddabf4b8bdc37 -SHA1 (patch-mozilla_media_mtransport_third__party_nrappkit_src_util_util.c) = 5e584a7186fd4f3b29ad3a2b12ee3a9c343f3fc8 -SHA1 (patch-mozilla_media_webrtc_signaling_signaling.gyp) = dc04e99b4231e4364f9cb347d83bad663dcfcdfd -SHA1 (patch-mozilla_media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c) = 266164bbf2d9c0d64971eb58f7c57dbd71604e44 -SHA1 (patch-mozilla_media_webrtc_signaling_test_Makefile.in) = 3f1ebf8e02671eac6a0bd919d304d0065fbe6572 -SHA1 (patch-mozilla_media_webrtc_trunk_build_build__config.h) = 851e7c9464e9cecd9599ae104a25622c64f5f41e -SHA1 (patch-mozilla_media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py) = 77536c92ebe9928302e10fd566cbabcb00bce0f5 -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi) = 69cebc33717779a39f31082a0385e2badf4df88b -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc) = bb1dbd928570a0a23c0d38fd9dae41dd754b2c94 -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc) = f6a3d554332502f7d92006044a7884bb516baad9 +SHA1 (patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h) = 533e7f8bb727e88b1c39834d5d701f100ee71933 +SHA1 (patch-mozilla_media_webrtc_signaling_signaling.gyp) = da5af008d351da2558c00402053ad4feb4c826fc +SHA1 (patch-mozilla_media_webrtc_signaling_test_Makefile.in) = 605e52abfdefde959ff701062de08ebdfa0b3c9d +SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi) = c245585c1fc3ddbafe931cf7c8dc8c0f2c466825 SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc) = 5f998126ad44ffdfe79f62a8f8221631eea7f459 SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc) = f66c65c46789417941805721116f7fa789be4904 SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi) = 4040cfa0170417d96115b4c87940786099366b13 -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc) = b699a6fd714b542e2087d8409d74f25db889d8e3 -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc) = 74191cd2ef207e5abd465c9759d279fafddefb2d -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp) = fd8c2a801427e4354b759b2545a11f8acad4fdf6 -SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc) = 9c76fc29799dee291a9276054d0b0cea3d63b75b +SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_clock.cc) = 942f11a6a9433a8d7ca75e21524aeed5e95f253d +SHA1 (patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp) = aaef09e06b2fe769d2502a41febcbc38c3a75b41 +SHA1 (patch-mozilla_memory_mozalloc_fallible.h) = c9b581ad467858e5bbcaec3ecdb4630ee64378c2 +SHA1 (patch-mozilla_memory_mozalloc_mozalloc.cpp) = 12b27ce71eea0a14006bf5443b33110bb353bc58 +SHA1 (patch-mozilla_memory_mozalloc_mozalloc.h) = 686a53ad5ea6a1a3c36592b6334d6bf1455f0c14 SHA1 (patch-mozilla_memory_mozalloc_mozalloc__abort.cpp) = 6fc6da6ea50b85377a27e2448b2d95570c539479 -SHA1 (patch-mozilla_mfbt_Atomics.h) = 7d4e4a394063eabda1fddd3a3d0228c84ecaf2e8 SHA1 (patch-mozilla_mfbt_Poison.cpp) = c01b2ef4bbb061585673d434a88036c67aa1a153 SHA1 (patch-mozilla_modules_libjar_nsZipArchive.cpp) = a399e0bd0e83c47938bbee077eaa79fc52386241 -SHA1 (patch-mozilla_modules_libpref_src_init_all.js) = 3580919b10fd558713b08d5fa93c64c15d8c0764 SHA1 (patch-mozilla_netwerk_sctp_src_netinet6_sctp6__usrreq.c) = dd166d48093684ee650a059d83008939cfad23fe SHA1 (patch-mozilla_netwerk_sctp_src_netinet_sctp__os__userspace.h) = 0961bbaa82191669a52ef9464776fbe744dec548 SHA1 (patch-mozilla_netwerk_sctp_src_netinet_sctp__usrreq.c) = 398c6638c71aa499e2b60f8b71f0c4006d832d5c SHA1 (patch-mozilla_netwerk_sctp_src_user__recv__thread.c) = c143363510a179c3c46e106dd8cd46718a7b1ac3 SHA1 (patch-mozilla_netwerk_sctp_src_user__socket.c) = a82b0f6d0d4717bfa593e7f3c53c3a229cfa6942 SHA1 (patch-mozilla_netwerk_sctp_src_user__socketvar.h) = 6d34abb3d8ecc5c8b36bfa594dc11a99facfa13b -SHA1 (patch-mozilla_netwerk_wifi_moz.build) = f2232f82ee267fdbbcf1c4090390a6bea9bf5849 +SHA1 (patch-mozilla_netwerk_wifi_moz.build) = 24659fc9471a30ca5e961cca53544700877e80ed SHA1 (patch-mozilla_netwerk_wifi_nsWifiScannerFreeBSD.cpp) = 780dabd37ea0eab07932489181de4cdfe0a5b4a3 SHA1 (patch-mozilla_security_manager_ssl_src_JARSignatureVerification.cpp) = 9f265784d23be668dbb1fcb4e09185670a298293 SHA1 (patch-mozilla_security_manager_ssl_src_nsNSSComponent.cpp) = 56531146315f3eac703a02ed23ef90f7ac4917b9 SHA1 (patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm) = bef62d06b0a840be9d41f7c96acb39ca5bd107d7 SHA1 (patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm) = 84c7aeeab671115c99f9b9afa7b0958830167e49 -SHA1 (patch-mozilla_toolkit_library_Makefile.in) = e7915dacee2a0bd3983cafd421ffe55ed54a5874 +SHA1 (patch-mozilla_toolkit_library_Makefile.in) = fdd37a7fd39b2cd82b3dd2a3e57bbc3b39e11d4d SHA1 (patch-mozilla_toolkit_mozapps_update_updater_updater.cpp) = 2d4769262671a41950d872f46806374efbbccb37 -SHA1 (patch-mozilla_toolkit_toolkit.mozbuild) = d0510df2e3fb3a7c5dd713b36351e72961788345 +SHA1 (patch-mozilla_toolkit_toolkit.mozbuild) = fbab6bc812003f4af11524fa4e50f48476972eac SHA1 (patch-mozilla_toolkit_xre_Makefile.in) = b8d51e994008f007b4fc1caec24a6eebe200b55b SHA1 (patch-mozilla_toolkit_xre_nsEmbedFunctions.cpp) = 70030e59b2ed09b9bc9827d35e17b12be7f0cd71 +SHA1 (patch-mozilla_xpcom_base_nsMemoryInfoDumper.cpp) = e22308b4b60ba5393a74d4a619a7342f7a121756 +SHA1 (patch-mozilla_xpcom_base_nsMemoryReporterManager.cpp) = 0d9cf3feb87523e7845409b27363d13d2b054a1e SHA1 (patch-mozilla_xpcom_base_nsStackWalk.cpp) = 6946cbbd8389e35a13ad457b8cbb4da91e0d8925 SHA1 (patch-mozilla_xpcom_ds_TimeStamp.h) = 3f751a097ec60ad743a3fa2d6ba9c3b36d633176 -SHA1 (patch-mozilla_xpcom_ds_moz.build) = 6abb1dc070e51fde11f49859bcc7359e87323dfb +SHA1 (patch-mozilla_xpcom_ds_moz.build) = 2b47c1c699863d0d823a11f1cad514c95b034509 SHA1 (patch-mozilla_xpcom_reflect_xptcall_src_md_unix_moz.build) = 75baafd5ccb281d54cc38cb1ca6b24d79b655626 SHA1 (patch-mozilla_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp) = 2868370f4112bcb8da5ed879e661856949750fb9 SHA1 (patch-mozilla_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__ppc__netbsd.cpp) = e6bdc6adc373dab89bd1ab9546db8fffd41cb38c diff --git a/www/seamonkey/enigmail.mk b/www/seamonkey/enigmail.mk index fb6f2c66fac..362dbfef406 100644 --- a/www/seamonkey/enigmail.mk +++ b/www/seamonkey/enigmail.mk @@ -1,4 +1,4 @@ -# $NetBSD: enigmail.mk,v 1.11 2013/11/04 06:01:46 ryoon Exp $ +# $NetBSD: enigmail.mk,v 1.12 2013/12/26 13:17:37 ryoon Exp $ # # This Makefile fragment hooks the Enigmail OpenPGP extension # (see http://www.mozilla-enigmail.org/ ) into the build. @@ -30,19 +30,21 @@ enigmail-post-extract: post-configure: enigmail-post-configure .PHONY: enigmail-post-configure enigmail-post-configure: - ${RUN} cd ${WRKSRC}/mailnews/extensions/enigmail && \ - ${SETENV} ${CONFIGURE_ENV} ${PERL5} ./makemake -r + ${MKDIR} -p ${WRKSRC}/${OBJDIR}/mailnews/extensions/enigmail + cd ${WRKSRC}/mailnews/extensions/enigmail && \ + ${SETENV} ${CONFIGURE_ENV} ${PERL5} ./makemake -r \ + -o ${WRKSRC}/${OBJDIR} # We need to do a switcheroo of the dist directory while building enigmail; # otherwise we get extra files contamination in the PLIST. post-build: enigmail-post-build .PHONY: enigmail-post-build enigmail-post-build: - ${RUN} cd ${WRKSRC}/mozilla/dist && pax -rwpe . ../dist.save - ${RUN} cd ${WRKSRC}/mailnews/extensions/enigmail && \ - ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} && \ - ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} xpi - ${CP} ${WRKSRC}/mozilla/dist/bin/enigmail*.xpi \ + rm -rf ${WRKSRC}/${OBJDIR}/mozilla/dist.save + cd ${WRKSRC}/${OBJDIR}/mozilla/dist && pax -rwpe . ../dist.save + cd ${WRKSRC}/${OBJDIR}/mailnews/extensions/enigmail && \ + ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} all xpi + ${CP} ${WRKSRC}/${OBJDIR}/mozilla/dist/bin/enigmail*.xpi \ ${WRKDIR}/enigmail.xpi - ${RUN} rm -rf ${WRKSRC}/mozilla/dist - ${RUN} cd ${WRKSRC}/mozilla/dist.save && pax -rwpe . ../dist + rm -rf ${WRKSRC}/${OBJDIR}/mozilla/dist + cd ${WRKSRC}/${OBJDIR}/mozilla/dist.save && pax -rwpe . ../dist diff --git a/www/seamonkey/options.mk b/www/seamonkey/options.mk index 06a278f1436..9edee0e1d69 100644 --- a/www/seamonkey/options.mk +++ b/www/seamonkey/options.mk @@ -1,4 +1,4 @@ -# $NetBSD: options.mk,v 1.27 2013/11/23 02:39:25 ryoon Exp $ +# $NetBSD: options.mk,v 1.28 2013/12/26 13:17:37 ryoon Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.seamonkey PKG_SUPPORTED_OPTIONS= debug mozilla-jemalloc gnome mozilla-enigmail @@ -54,8 +54,8 @@ CONFIGURE_ARGS+= --enable-install-strip .if !empty(PKG_OPTIONS:Mmozilla-lightning) CONFIGURE_ARGS+= --enable-calendar PLIST_SRC+= PLIST.lightning -XPI_FILES+= ${WRKSRC}/mozilla/dist/xpi-stage/gdata-provider*.xpi -XPI_FILES+= ${WRKSRC}/mozilla/dist/xpi-stage/lightning*.xpi +XPI_FILES+= ${WRKSRC}/${OBJDIR}/mozilla/dist/xpi-stage/gdata-provider*.xpi +XPI_FILES+= ${WRKSRC}/${OBJDIR}/mozilla/dist/xpi-stage/lightning*.xpi .else CONFIGURE_ARGS+= --disable-calendar .endif diff --git a/www/seamonkey/patches/patch-aa b/www/seamonkey/patches/patch-aa index db18d21791a..6f4d4a665c0 100644 --- a/www/seamonkey/patches/patch-aa +++ b/www/seamonkey/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-aa,v 1.20 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/configure.in.orig 2013-10-29 01:20:42.000000000 +0000 +--- mozilla/configure.in.orig 2013-12-11 04:28:28.000000000 +0000 +++ mozilla/configure.in -@@ -2819,6 +2819,7 @@ EOF +@@ -2752,6 +2752,7 @@ EOF #pragma GCC visibility push(hidden) #pragma GCC visibility push(default) #include <string.h> @@ -10,7 +10,7 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ #pragma GCC visibility pop __attribute__ ((visibility ("default"))) void Func() { -@@ -2827,7 +2828,7 @@ __attribute__ ((visibility ("default"))) +@@ -2760,7 +2761,7 @@ __attribute__ ((visibility ("default"))) } EOF ac_cv_have_visibility_builtin_bug=no @@ -19,7 +19,7 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ ac_cv_have_visibility_builtin_bug=yes else if test `grep -c "@PLT" conftest.S` = 0; then -@@ -3283,14 +3284,22 @@ fi +@@ -3216,14 +3217,22 @@ fi AC_CACHE_CHECK( [for res_ninit()], ac_cv_func_res_ninit, @@ -45,7 +45,7 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ [ac_cv_func_res_ninit=no]) ]) -@@ -3941,6 +3950,14 @@ if test -n "$YASM"; then +@@ -3874,6 +3883,14 @@ if test -n "$YASM"; then _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'` fi @@ -60,7 +60,7 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ if test -z "$SKIP_LIBRARY_CHECKS"; then dnl system JPEG support dnl ======================================================== -@@ -3968,11 +3985,7 @@ if test "$MOZ_NATIVE_JPEG" = 1; then +@@ -3901,11 +3918,7 @@ if test "$MOZ_NATIVE_JPEG" = 1; then #include <jpeglib.h> ], [ #if JPEG_LIB_VERSION < $MOZJPEG #error "Insufficient JPEG library version ($MOZJPEG required)." @@ -73,8 +73,8 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ MOZ_NATIVE_JPEG=1, AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg])) fi -@@ -4113,6 +4126,22 @@ if test -n "$MOZ_NATIVE_FFI"; then - fi +@@ -4062,6 +4075,22 @@ fi + AC_SUBST(MOZ_NATIVE_ICU) dnl ======================================================== +dnl system icu support @@ -96,26 +96,20 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ dnl Java SDK support dnl ======================================================== -@@ -5256,7 +5285,7 @@ dnl --enable-webrtc to override. Can di - dnl the master list above. - if test -n "$MOZ_WEBRTC"; then - case "$target" in -- *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*) -+ *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*) - dnl Leave enabled - ;; - *) -@@ -5312,6 +5341,9 @@ if test -n "$MOZ_WEBRTC"; then +@@ -5281,6 +5310,12 @@ if test -n "$MOZ_WEBRTC"; then MOZ_VP8_ENCODER=1 MOZ_VP8_ERROR_CONCEALMENT=1 + dnl with libv4l2 we can support more cameras + PKG_CHECK_MODULES(MOZ_LIBV4L2, libv4l2) + ++ dnl with libv4l2 we can support more cameras ++ PKG_CHECK_MODULES(MOZ_LIBV4L2, libv4l2) ++ dnl enable once Signaling lands MOZ_WEBRTC_SIGNALING=1 AC_DEFINE(MOZ_WEBRTC_SIGNALING) -@@ -5338,15 +5370,18 @@ AC_SUBST(MOZ_SRTP) +@@ -5307,15 +5342,18 @@ AC_SUBST(MOZ_SRTP) dnl Use integers over floats for audio on B2G and Android, because audio dnl backends for those platforms don't support floats. @@ -137,7 +131,7 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ dnl ======================================================== dnl = Disable Speech API code -@@ -8402,7 +8437,7 @@ case "$OS_TARGET" in +@@ -8276,7 +8314,7 @@ case "$OS_TARGET" in NECKO_WIFI=1 fi ;; @@ -146,7 +140,7 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ NECKO_WIFI=1 ;; Linux) -@@ -9124,6 +9159,10 @@ if test -n "$INTEL_ARCHITECTURE"; then +@@ -9005,6 +9043,14 @@ if test -n "$INTEL_ARCHITECTURE"; then fi fi @@ -154,24 +148,10 @@ $NetBSD: patch-aa,v 1.19 2013/11/04 06:01:46 ryoon Exp $ + EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D use_libv4l2=1" +fi + ++if test -n "$MOZ_LIBV4L2_LIBS"; then ++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D use_libv4l2=1" ++fi ++ if test -n "$MOZ_WEBRTC"; then AC_MSG_RESULT("generating WebRTC Makefiles...") -@@ -9419,15 +9458,14 @@ dist=$MOZ_BUILD_ROOT/dist - ac_configure_args="$_SUBDIR_CONFIG_ARGS" - ac_configure_args="$ac_configure_args --enable-threadsafe" - # Switch to "$MOZ_BUILD_APP" != "browser" when enabling for desktop builds. --if test "A" = "A"; then -+#if test "A" = "A"; then - # The Internationalization API isn't on by default except in standalone JS - # engine builds. Bugs to enable it in the browser: - # - # Desktop: bug 853301 - # Android: bug 864843 - # B2G: bug 866301 -- ac_configure_args="$ac_configure_args --disable-intl-api" --fi -+#fi - if test "$BUILD_CTYPES"; then - # Build js-ctypes on the platforms we can. - ac_configure_args="$ac_configure_args --enable-ctypes" diff --git a/www/seamonkey/patches/patch-as b/www/seamonkey/patches/patch-as index 2b2e199591b..c153d027e2f 100644 --- a/www/seamonkey/patches/patch-as +++ b/www/seamonkey/patches/patch-as @@ -1,11 +1,11 @@ -$NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-as,v 1.15 2013/12/26 13:17:37 ryoon Exp $ * Fix _res is not supported for multi-threaded programs. error. * Treat DragonFly like FreeBSD. ---- mozilla/js/src/configure.in.orig 2013-10-29 01:20:53.000000000 +0000 +--- mozilla/js/src/configure.in.orig 2013-12-11 04:28:40.000000000 +0000 +++ mozilla/js/src/configure.in -@@ -2347,6 +2347,7 @@ EOF +@@ -2290,6 +2290,7 @@ EOF #pragma GCC visibility push(hidden) #pragma GCC visibility push(default) #include <string.h> @@ -13,7 +13,7 @@ $NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ #pragma GCC visibility pop __attribute__ ((visibility ("default"))) void Func() { -@@ -2355,7 +2356,7 @@ __attribute__ ((visibility ("default"))) +@@ -2298,7 +2299,7 @@ __attribute__ ((visibility ("default"))) } EOF ac_cv_have_visibility_builtin_bug=no @@ -22,7 +22,7 @@ $NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ ac_cv_have_visibility_builtin_bug=yes else if test `grep -c "@PLT" conftest.S` = 0; then -@@ -2572,7 +2573,7 @@ then +@@ -2515,7 +2516,7 @@ then fi case "$target" in @@ -31,7 +31,7 @@ $NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) dnl -pthread links in -lpthread, so don't specify it explicitly. -@@ -2657,14 +2658,22 @@ fi +@@ -2600,14 +2601,22 @@ fi AC_CACHE_CHECK( [for res_ninit()], ac_cv_func_res_ninit, @@ -57,7 +57,7 @@ $NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ [ac_cv_func_res_ninit=no]) ]) -@@ -3361,7 +3370,7 @@ if test "$MOZ_MEMORY"; then +@@ -3316,7 +3325,7 @@ if test "$MOZ_MEMORY"; then *-darwin*) AC_DEFINE(MOZ_MEMORY_DARWIN) ;; @@ -66,9 +66,9 @@ $NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ AC_DEFINE(MOZ_MEMORY_BSD) ;; *-android*|*-linuxandroid*) -@@ -4246,6 +4255,16 @@ fi +@@ -4339,6 +4348,16 @@ fi dnl ======================================================== - dnl ECMAScript Internationalization API Support (uses ICU) + dnl JavaScript shell dnl ======================================================== +ICU_LIB_NAMES= +MOZ_NATIVE_ICU= @@ -81,65 +81,5 @@ $NetBSD: patch-as,v 1.14 2013/11/04 06:01:46 ryoon Exp $ + PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1) +fi - ENABLE_INTL_API=1 - MOZ_ARG_DISABLE_BOOL(intl-api, -@@ -4255,37 +4274,36 @@ MOZ_ARG_DISABLE_BOOL(intl-api, - dnl Settings for the implementation of the ECMAScript Internationalization API - if test -n "$ENABLE_INTL_API"; then - AC_DEFINE(ENABLE_INTL_API) -- # We build ICU as a static library. -- AC_DEFINE(U_STATIC_IMPLEMENTATION) -- -- case "$OS_TARGET" in -- WINNT) -- ICU_LIB_NAMES="icuin icuuc icudt" -- ;; -- Darwin|Linux) -- ICU_LIB_NAMES="icui18n icuuc icudata" -- ;; -- *) -- AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform]) -- esac - -- ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)' --else -- ICU_LIB_NAMES= -- ICU_LIBS= -+ if test -z "$MOZ_NATIVE_ICU"; then -+ case "$OS_TARGET" in -+ WINNT) -+ ICU_LIB_NAMES="icuin icuuc icudt" -+ ;; -+ Darwin|Linux) -+ ICU_LIB_NAMES="icui18n icuuc icudata" -+ ;; -+ *) -+ AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform]) -+ esac -+ MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)' -+ fi - fi - - AC_SUBST(ENABLE_INTL_API) - AC_SUBST(ICU_LIB_NAMES) --AC_SUBST(ICU_LIBS) -+AC_SUBST(MOZ_ICU_LIBS) -+AC_SUBST(MOZ_NATIVE_ICU) - --dnl Source files that use ICU should have control over which parts of the ICU --dnl namespace they want to use. --AC_DEFINE(U_USING_ICU_NAMESPACE,0) -+dnl Settings for ICU -+if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then -+ dnl We build ICU as a static library. -+ AC_DEFINE(U_STATIC_IMPLEMENTATION) - -+ dnl Source files that use ICU should have control over which parts of the ICU -+ dnl namespace they want to use. -+ AC_DEFINE(U_USING_ICU_NAMESPACE,0) - --dnl Settings for ICU --if test -n "$ENABLE_INTL_API" ; then - # Set ICU compile options - ICU_CPPFLAGS="" - # don't use icu namespace automatically in client code + AC_HAVE_FUNCS(setlocale) + AC_HAVE_FUNCS(localeconv) diff --git a/www/seamonkey/patches/patch-config_baseconfig.mk b/www/seamonkey/patches/patch-config_baseconfig.mk index 03c785b9112..2ab29ce9637 100644 --- a/www/seamonkey/patches/patch-config_baseconfig.mk +++ b/www/seamonkey/patches/patch-config_baseconfig.mk @@ -1,10 +1,8 @@ -$NetBSD: patch-config_baseconfig.mk,v 1.2 2013/01/07 21:55:30 ryoon Exp $ +$NetBSD: patch-config_baseconfig.mk,v 1.3 2013/12/26 13:17:37 ryoon Exp $ ---- config/baseconfig.mk.orig 2012-11-18 10:14:23.000000000 +0000 +--- config/baseconfig.mk.orig 2013-12-11 04:19:54.000000000 +0000 +++ config/baseconfig.mk -@@ -1,9 +1,9 @@ - INCLUDED_AUTOCONF_MK = 1 - +@@ -1,7 +1,7 @@ -includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) diff --git a/www/seamonkey/patches/patch-config_config.mk b/www/seamonkey/patches/patch-config_config.mk new file mode 100644 index 00000000000..29571df0c81 --- /dev/null +++ b/www/seamonkey/patches/patch-config_config.mk @@ -0,0 +1,18 @@ +$NetBSD: patch-config_config.mk,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +From +http://www.openbsd.org/cgi-bin/cvsweb/ports/www/seamonkey/patches/patch-config_config_mk?rev=1.1 + +Fix fallout from http://hg.mozilla.org/releases/comm-release/rev/a6ab55f00e21 +XPIDL_LINK being undefined breaks enigmail build + +--- config/config.mk.orig 2013-12-11 04:19:54.000000000 +0000 ++++ config/config.mk +@@ -325,6 +325,7 @@ MY_RULES := $(DEPTH)/config/myrules.mk + # Default command macros; can be overridden in <arch>.mk. + # + CCC = $(CXX) ++XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link + + OS_INCLUDES += $(NSPR_CFLAGS) $(NSS_CFLAGS) $(MOZ_JPEG_CFLAGS) $(MOZ_PNG_CFLAGS) $(MOZ_ZLIB_CFLAGS) + diff --git a/www/seamonkey/patches/patch-mail_app_Makefile.in b/www/seamonkey/patches/patch-mail_app_Makefile.in index b9c43993a42..2eb5095bb07 100644 --- a/www/seamonkey/patches/patch-mail_app_Makefile.in +++ b/www/seamonkey/patches/patch-mail_app_Makefile.in @@ -1,8 +1,8 @@ -$NetBSD: patch-mail_app_Makefile.in,v 1.6 2013/01/07 21:55:30 ryoon Exp $ +$NetBSD: patch-mail_app_Makefile.in,v 1.7 2013/12/26 13:17:37 ryoon Exp $ ---- mail/app/Makefile.in.orig 2012-11-18 10:14:23.000000000 +0000 +--- mail/app/Makefile.in.orig 2013-12-11 04:19:55.000000000 +0000 +++ mail/app/Makefile.in -@@ -63,6 +63,10 @@ LOCAL_INCLUDES += \ +@@ -57,6 +57,10 @@ LOCAL_INCLUDES += \ DEFINES += -DXPCOM_GLUE STL_FLAGS= @@ -11,5 +11,5 @@ $NetBSD: patch-mail_app_Makefile.in,v 1.6 2013/01/07 21:55:30 ryoon Exp $ +endif + LIBS += \ - $(EXTRA_DSO_LIBS) \ $(XPCOM_STANDALONE_GLUE_LDOPTS) \ + $(NULL) diff --git a/www/seamonkey/patches/patch-mailnews_extensions_enigmail_ipc_modules_subprocess.jsm b/www/seamonkey/patches/patch-mailnews_extensions_enigmail_ipc_modules_subprocess.jsm new file mode 100644 index 00000000000..ff0441d0927 --- /dev/null +++ b/www/seamonkey/patches/patch-mailnews_extensions_enigmail_ipc_modules_subprocess.jsm @@ -0,0 +1,14 @@ +$NetBSD: patch-mailnews_extensions_enigmail_ipc_modules_subprocess.jsm,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mailnews/extensions/enigmail/ipc/modules/subprocess.jsm.orig 2013-10-06 16:31:34.000000000 +0000 ++++ mailnews/extensions/enigmail/ipc/modules/subprocess.jsm +@@ -324,7 +324,9 @@ function getPlatformValue(valueType) { + // library name O_NONBLOCK RLIM_T RLIMIT_NOFILE + 'darwin': [ 'libc.dylib', 0x04 , ctypes.uint64_t , 8 ], + 'linux': [ 'libc.so.6', 2024 , ctypes.unsigned_long, 7 ], ++ 'dragonfly': [ 'libc.so', 0x04 , ctypes.int64_t , 8 ], + 'freebsd': [ 'libc.so.7', 0x04 , ctypes.int64_t , 8 ], ++ 'netbsd': [ 'libc.so', 0x04 , ctypes.int64_t , 8 ], + 'openbsd': [ 'libc.so.61.0', 0x04 , ctypes.int64_t , 8 ], + 'sunos': [ 'libc.so', 0x80 , ctypes.unsigned_long, 5 ] + }; diff --git a/www/seamonkey/patches/patch-mailnews_extensions_enigmail_ipc_src_Makefile.enig b/www/seamonkey/patches/patch-mailnews_extensions_enigmail_ipc_src_Makefile.enig new file mode 100644 index 00000000000..de76e1666b7 --- /dev/null +++ b/www/seamonkey/patches/patch-mailnews_extensions_enigmail_ipc_src_Makefile.enig @@ -0,0 +1,15 @@ +$NetBSD: patch-mailnews_extensions_enigmail_ipc_src_Makefile.enig,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mailnews/extensions/enigmail/ipc/src/Makefile.enig.orig 2013-10-06 16:31:34.000000000 +0000 ++++ mailnews/extensions/enigmail/ipc/src/Makefile.enig +@@ -18,8 +18,8 @@ LDFLAGS += -dynamiclib -install_name @ex + endif + + ifeq ($(OS_ARCH),NetBSD) +-ifeq ($(DLL_SUFFIX),.so.1.0) +-LDFLAGS += -Wl,-Bsymbolic ++ifeq ($(DLL_SUFFIX),.so) ++LDFLAGS += -shared -Wl,-Bsymbolic + CFLAGS += -fPIC + endif + endif diff --git a/www/seamonkey/patches/patch-mozilla_config_Makefile.in b/www/seamonkey/patches/patch-mozilla_config_Makefile.in deleted file mode 100644 index bbc883bd4b9..00000000000 --- a/www/seamonkey/patches/patch-mozilla_config_Makefile.in +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-mozilla_config_Makefile.in,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/config/Makefile.in.orig 2013-09-16 18:26:27.000000000 +0000 -+++ mozilla/config/Makefile.in -@@ -102,6 +102,7 @@ export:: $(export-preqs) - -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \ - -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ - -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ -+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ - $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers - $(INSTALL) system_wrappers $(DIST) - diff --git a/www/seamonkey/patches/patch-mozilla_config_baseconfig.mk b/www/seamonkey/patches/patch-mozilla_config_baseconfig.mk index cf313fb645e..b9e758bf10c 100644 --- a/www/seamonkey/patches/patch-mozilla_config_baseconfig.mk +++ b/www/seamonkey/patches/patch-mozilla_config_baseconfig.mk @@ -1,10 +1,8 @@ -$NetBSD: patch-mozilla_config_baseconfig.mk,v 1.3 2013/08/11 03:18:46 ryoon Exp $ +$NetBSD: patch-mozilla_config_baseconfig.mk,v 1.4 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/config/baseconfig.mk.orig 2013-08-04 03:05:18.000000000 +0000 +--- mozilla/config/baseconfig.mk.orig 2013-12-11 04:28:28.000000000 +0000 +++ mozilla/config/baseconfig.mk -@@ -1,9 +1,9 @@ - INCLUDED_AUTOCONF_MK = 1 - +@@ -1,7 +1,7 @@ -includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) diff --git a/www/seamonkey/patches/patch-mozilla_config_stl-headers b/www/seamonkey/patches/patch-mozilla_config_stl-headers deleted file mode 100644 index ac4cf786455..00000000000 --- a/www/seamonkey/patches/patch-mozilla_config_stl-headers +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-mozilla_config_stl-headers,v 1.1 2013/11/08 12:55:52 ryoon Exp $ - ---- mozilla/config/stl-headers.orig 2013-10-29 01:20:42.000000000 +0000 -+++ mozilla/config/stl-headers -@@ -21,6 +21,7 @@ algorithm - atomic - deque - ios -+iosfwd - iostream - iterator - limits diff --git a/www/seamonkey/patches/patch-mozilla_config_system-headers b/www/seamonkey/patches/patch-mozilla_config_system-headers index 67fa040f5e7..15af8c196b1 100644 --- a/www/seamonkey/patches/patch-mozilla_config_system-headers +++ b/www/seamonkey/patches/patch-mozilla_config_system-headers @@ -1,27 +1,9 @@ -$NetBSD: patch-mozilla_config_system-headers,v 1.8 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_config_system-headers,v 1.9 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/config/system-headers.orig 2013-10-29 01:20:42.000000000 +0000 +--- mozilla/config/system-headers.orig 2013-12-11 04:28:28.000000000 +0000 +++ mozilla/config/system-headers -@@ -469,6 +469,7 @@ IOKit/IOMessage.h - IOKit/pwr_mgt/IOPMLib.h - iomanip - ios -+iosfwd - iostream - iostream.h - iterator -@@ -1132,3 +1133,14 @@ kvm.h - spawn.h - err.h - xlocale.h -+#if MOZ_NATIVE_ICU==1 -+unicode/locid.h -+unicode/numsys.h -+unicode/ucal.h -+unicode/ucol.h -+unicode/udat.h -+unicode/udatpg.h -+unicode/uenum.h -+unicode/unum.h -+unicode/ustring.h -+#endif +@@ -1144,3 +1144,4 @@ unicode/unum.h + unicode/ustring.h + unicode/utypes.h + #endif ++libutil.h diff --git a/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util.h b/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util.h index 0affae4b08a..34604bfe15d 100644 --- a/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util.h +++ b/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util.h @@ -1,6 +1,6 @@ -$NetBSD: patch-mozilla_ipc_chromium_src_base_file__util.h,v 1.1 2013/08/11 03:18:46 ryoon Exp $ +$NetBSD: patch-mozilla_ipc_chromium_src_base_file__util.h,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/ipc/chromium/src/base/file_util.h.orig 2013-08-04 03:05:29.000000000 +0000 +--- mozilla/ipc/chromium/src/base/file_util.h.orig 2013-12-11 04:28:40.000000000 +0000 +++ mozilla/ipc/chromium/src/base/file_util.h @@ -16,7 +16,9 @@ #include <sys/stat.h> @@ -12,12 +12,3 @@ $NetBSD: patch-mozilla_ipc_chromium_src_base_file__util.h,v 1.1 2013/08/11 03:18 #include <sys/stat.h> #endif -@@ -466,7 +468,7 @@ class FileEnumerator { - #if defined(OS_WIN) - WIN32_FIND_DATA find_data_; - HANDLE find_handle_; --#elif defined(ANDROID) -+#elif defined(ANDROID) || defined(OS_SOLARIS) - void *fts_; - #elif defined(OS_POSIX) - FTS* fts_; diff --git a/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc b/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc index d65ef3b4585..81bf4897abe 100644 --- a/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc +++ b/www/seamonkey/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc @@ -1,6 +1,6 @@ -$NetBSD: patch-mozilla_ipc_chromium_src_base_file__util__posix.cc,v 1.1 2013/08/11 03:18:46 ryoon Exp $ +$NetBSD: patch-mozilla_ipc_chromium_src_base_file__util__posix.cc,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig 2013-08-04 03:05:29.000000000 +0000 +--- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig 2013-12-11 04:28:40.000000000 +0000 +++ mozilla/ipc/chromium/src/base/file_util_posix.cc @@ -8,7 +8,7 @@ #include <errno.h> @@ -11,7 +11,7 @@ $NetBSD: patch-mozilla_ipc_chromium_src_base_file__util__posix.cc,v 1.1 2013/08/ #include <fts.h> #endif #include <libgen.h> -@@ -121,7 +121,7 @@ bool Delete(const FilePath& path, bool r +@@ -67,7 +67,7 @@ bool Delete(const FilePath& path, bool r if (!recursive) return (rmdir(path_str) == 0); @@ -20,7 +20,7 @@ $NetBSD: patch-mozilla_ipc_chromium_src_base_file__util__posix.cc,v 1.1 2013/08/ // XXX Need ftsless impl for bionic return false; #else -@@ -194,7 +194,7 @@ bool CopyDirectory(const FilePath& from_ +@@ -140,7 +140,7 @@ bool CopyDirectory(const FilePath& from_ return false; } @@ -29,30 +29,3 @@ $NetBSD: patch-mozilla_ipc_chromium_src_base_file__util__posix.cc,v 1.1 2013/08/ // XXX Need ftsless impl for bionic return false; #else -@@ -613,7 +613,7 @@ FileEnumerator::FileEnumerator(const Fil - } - - FileEnumerator::~FileEnumerator() { --#ifndef ANDROID -+#if !defined(ANDROID) && !defined(OS_SOLARIS) - if (fts_) - fts_close(fts_); - #endif -@@ -625,7 +625,7 @@ void FileEnumerator::GetFindInfo(FindInf - if (!is_in_find_op_) - return; - --#ifndef ANDROID -+#if !defined(ANDROID) && !defined(OS_SOLARIS) - memcpy(&(info->stat), fts_ent_->fts_statp, sizeof(info->stat)); - info->filename.assign(fts_ent_->fts_name); - #endif -@@ -636,7 +636,7 @@ void FileEnumerator::GetFindInfo(FindInf - // large directories with many files this can be quite deep. - // TODO(erikkay) - get rid of this recursive pattern - FilePath FileEnumerator::Next() { --#ifdef ANDROID -+#if defined(ANDROID) || defined(OS_SOLARIS) - return FilePath(); - #else - if (!is_in_find_op_) { diff --git a/www/seamonkey/patches/patch-mozilla_js_src_Makefile.in b/www/seamonkey/patches/patch-mozilla_js_src_Makefile.in index 807f9aba667..038f1c24641 100644 --- a/www/seamonkey/patches/patch-mozilla_js_src_Makefile.in +++ b/www/seamonkey/patches/patch-mozilla_js_src_Makefile.in @@ -1,52 +1,8 @@ -$NetBSD: patch-mozilla_js_src_Makefile.in,v 1.3 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_js_src_Makefile.in,v 1.4 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/js/src/Makefile.in.orig 2013-10-29 01:20:53.000000000 +0000 +--- mozilla/js/src/Makefile.in.orig 2013-12-11 04:28:40.000000000 +0000 +++ mozilla/js/src/Makefile.in -@@ -232,10 +232,14 @@ endif - # ICU headers need to be available whether we build with the complete - # Internationalization API or not - ICU stubs rely on them. - -+ifdef MOZ_NATIVE_ICU -+LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS) -+else - LOCAL_INCLUDES += \ - -I$(topsrcdir)/../../intl/icu/source/common \ - -I$(topsrcdir)/../../intl/icu/source/i18n \ - $(NULL) -+endif - - ifdef ENABLE_INTL_API - -@@ -255,6 +259,7 @@ else - ICU_MAKE = $(MAKE) - endif - -+ifndef MOZ_NATIVE_ICU - # - Build ICU as part of the "export" target, so things get built - # in the right order. - # - ICU requires GNU make according to its readme.html. pymake can't be used -@@ -269,6 +274,7 @@ export:: - - distclean clean:: - $(call SUBMAKE,$@,intl/icu) -+endif - - endif - -@@ -394,7 +400,11 @@ ifneq (,$(MOZ_ZLIB_LIBS)$(MOZ_GLUE_LDFLA - DEFINES += -DUSE_ZLIB - endif - --SHARED_LIBRARY_LIBS += $(ICU_LIBS) -+ifdef MOZ_NATIVE_ICU -+EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS) -+else -+SHARED_LIBRARY_LIBS += $(MOZ_ICU_LIBS) -+endif - - # Prevent floating point errors caused by VC++ optimizations - ifdef _MSC_VER -@@ -453,6 +463,13 @@ EXTRA_LIBS += -lposix4 -ldl -lnsl -lsock +@@ -467,6 +467,13 @@ EXTRA_LIBS += -lposix4 -ldl -lnsl -lsock endif endif diff --git a/www/seamonkey/patches/patch-mozilla_js_src_config_Makefile.in b/www/seamonkey/patches/patch-mozilla_js_src_config_Makefile.in deleted file mode 100644 index 0fb5563a3a7..00000000000 --- a/www/seamonkey/patches/patch-mozilla_js_src_config_Makefile.in +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-mozilla_js_src_config_Makefile.in,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/js/src/config/Makefile.in.orig 2013-09-16 18:26:39.000000000 +0000 -+++ mozilla/js/src/config/Makefile.in -@@ -59,6 +59,7 @@ export:: \ - $(call mkdir_deps,system_wrappers_js) \ - $(NULL) - $(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \ -+ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ - $(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js - $(INSTALL) system_wrappers_js $(DIST) - diff --git a/www/seamonkey/patches/patch-mozilla_js_src_config_system-headers b/www/seamonkey/patches/patch-mozilla_js_src_config_system-headers index 4daab3230ed..e25d214f4c9 100644 --- a/www/seamonkey/patches/patch-mozilla_js_src_config_system-headers +++ b/www/seamonkey/patches/patch-mozilla_js_src_config_system-headers @@ -1,27 +1,9 @@ -$NetBSD: patch-mozilla_js_src_config_system-headers,v 1.8 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_js_src_config_system-headers,v 1.9 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/js/src/config/system-headers.orig 2013-10-29 01:20:53.000000000 +0000 +--- mozilla/js/src/config/system-headers.orig 2013-12-11 04:28:40.000000000 +0000 +++ mozilla/js/src/config/system-headers -@@ -469,6 +469,7 @@ IOKit/IOMessage.h - IOKit/pwr_mgt/IOPMLib.h - iomanip - ios -+iosfwd - iostream - iostream.h - iterator -@@ -1132,3 +1133,14 @@ kvm.h - spawn.h - err.h - xlocale.h -+#if MOZ_NATIVE_ICU==1 -+unicode/locid.h -+unicode/numsys.h -+unicode/ucal.h -+unicode/ucol.h -+unicode/udat.h -+unicode/udatpg.h -+unicode/uenum.h -+unicode/unum.h -+unicode/ustring.h -+#endif +@@ -1144,3 +1144,4 @@ unicode/unum.h + unicode/ustring.h + unicode/utypes.h + #endif ++libutil.h diff --git a/www/seamonkey/patches/patch-mozilla_js_src_gdb_Makefile.in b/www/seamonkey/patches/patch-mozilla_js_src_gdb_Makefile.in deleted file mode 100644 index e0cf08e0ae9..00000000000 --- a/www/seamonkey/patches/patch-mozilla_js_src_gdb_Makefile.in +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-mozilla_js_src_gdb_Makefile.in,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/js/src/gdb/Makefile.in.orig 2013-09-16 18:26:39.000000000 +0000 -+++ mozilla/js/src/gdb/Makefile.in -@@ -19,6 +19,10 @@ LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$ - - LOCAL_INCLUDES += -I$(topsrcdir) -I.. - -+ifdef MOZ_NATIVE_ICU -+EXTRA_LIBS += $(MOZ_ICU_LIBS) -+endif -+ - EXTRA_LIBS += $(MOZ_FFI_LIBS) - - # Place a GDB Python auto-load file next to the gdb-tests executable, both diff --git a/www/seamonkey/patches/patch-mozilla_js_src_jsapi-tests_Makefile.in b/www/seamonkey/patches/patch-mozilla_js_src_jsapi-tests_Makefile.in deleted file mode 100644 index 1162a7240a7..00000000000 --- a/www/seamonkey/patches/patch-mozilla_js_src_jsapi-tests_Makefile.in +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-mozilla_js_src_jsapi-tests_Makefile.in,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/js/src/jsapi-tests/Makefile.in.orig 2013-09-16 18:26:40.000000000 +0000 -+++ mozilla/js/src/jsapi-tests/Makefile.in -@@ -20,6 +20,10 @@ LIBS = $(DEPTH)/$(LIB_PREFIX)js_sta - - LOCAL_INCLUDES += -I$(topsrcdir) -I.. - -+ifdef MOZ_NATIVE_ICU -+EXTRA_LIBS += $(MOZ_ICU_LIBS) -+endif -+ - EXTRA_LIBS += $(MOZ_FFI_LIBS) - - ifdef QEMU_EXE diff --git a/www/seamonkey/patches/patch-mozilla_js_src_shell_Makefile.in b/www/seamonkey/patches/patch-mozilla_js_src_shell_Makefile.in deleted file mode 100644 index eb3dab63d1f..00000000000 --- a/www/seamonkey/patches/patch-mozilla_js_src_shell_Makefile.in +++ /dev/null @@ -1,14 +0,0 @@ -$NetBSD: patch-mozilla_js_src_shell_Makefile.in,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/js/src/shell/Makefile.in.orig 2013-09-16 18:26:41.000000000 +0000 -+++ mozilla/js/src/shell/Makefile.in -@@ -27,6 +27,9 @@ LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS - ifdef MOZ_NATIVE_FFI - EXTRA_LIBS += $(MOZ_FFI_LIBS) - endif -+ifdef MOZ_NATIVE_ICU -+EXTRA_LIBS += $(MOZ_ICU_LIBS) -+endif - - LOCAL_INCLUDES += -I$(topsrcdir) -I.. - diff --git a/www/seamonkey/patches/patch-mozilla_js_src_vm_ObjectImpl-inl.h b/www/seamonkey/patches/patch-mozilla_js_src_vm_ObjectImpl-inl.h deleted file mode 100644 index e02397548c4..00000000000 --- a/www/seamonkey/patches/patch-mozilla_js_src_vm_ObjectImpl-inl.h +++ /dev/null @@ -1,31 +0,0 @@ -$NetBSD: patch-mozilla_js_src_vm_ObjectImpl-inl.h,v 1.4 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/js/src/vm/ObjectImpl-inl.h.orig 2013-09-16 18:26:43.000000000 +0000 -+++ mozilla/js/src/vm/ObjectImpl-inl.h -@@ -364,7 +364,7 @@ js::ObjectImpl::zone() const - js::ObjectImpl::readBarrier(ObjectImpl *obj) - { - #ifdef JSGC_INCREMENTAL -- Zone *zone = obj->zone(); -+ JS::Zone *zone = obj->zone(); - if (zone->needsBarrier()) { - MOZ_ASSERT(!zone->rt->isHeapMajorCollecting()); - JSObject *tmp = obj->asObjectPtr(); -@@ -378,7 +378,7 @@ inline void - js::ObjectImpl::privateWriteBarrierPre(void **old) - { - #ifdef JSGC_INCREMENTAL -- Zone *zone = this->zone(); -+ JS::Zone *zone = this->zone(); - if (zone->needsBarrier()) { - if (*old && getClass()->trace) - getClass()->trace(zone->barrierTracer(), this->asObjectPtr()); -@@ -405,7 +405,7 @@ js::ObjectImpl::writeBarrierPre(ObjectIm - if (IsNullTaggedPointer(obj) || !obj->runtime()->needsBarrier()) - return; - -- Zone *zone = obj->zone(); -+ JS::Zone *zone = obj->zone(); - if (zone->needsBarrier()) { - MOZ_ASSERT(!zone->rt->isHeapMajorCollecting()); - JSObject *tmp = obj->asObjectPtr(); diff --git a/www/seamonkey/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp b/www/seamonkey/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp index 7a952b1e4ee..960237bb77f 100644 --- a/www/seamonkey/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp +++ b/www/seamonkey/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp @@ -1,8 +1,16 @@ -$NetBSD: patch-mozilla_js_src_vm_SPSProfiler.cpp,v 1.3 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_js_src_vm_SPSProfiler.cpp,v 1.4 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/js/src/vm/SPSProfiler.cpp.orig 2013-10-29 01:20:57.000000000 +0000 +--- mozilla/js/src/vm/SPSProfiler.cpp.orig 2013-12-11 04:28:45.000000000 +0000 +++ mozilla/js/src/vm/SPSProfiler.cpp -@@ -10,6 +10,7 @@ +@@ -4,12 +4,15 @@ + * 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 "jscntxtinlines.h" ++ + #include "vm/SPSProfiler.h" + + #include "mozilla/DebugOnly.h" #include "jsnum.h" #include "jsscript.h" diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_objs.mk b/www/seamonkey/patches/patch-mozilla_media_mtransport_objs.mk deleted file mode 100644 index c46a0969b4f..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_objs.mk +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_objs.mk,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/objs.mk.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/objs.mk -@@ -23,12 +23,16 @@ LOCAL_INCLUDES += \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/event \ - $(NULL) - --ifeq ($(OS_TARGET), Darwin) -+ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET))) - LOCAL_INCLUDES += \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include \ - -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \ - $(NULL) -+ifeq ($(OS_TARGET), Darwin) - DEFINES += -DDARWIN -+else -+DEFINES += -DBSD -+endif - endif - - ifeq ($(OS_TARGET), Linux) diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_test_Makefile.in b/www/seamonkey/patches/patch-mozilla_media_mtransport_test_Makefile.in deleted file mode 100644 index f6ee0d3c176..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_test_Makefile.in +++ /dev/null @@ -1,20 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_test_Makefile.in,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/test/Makefile.in.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/test/Makefile.in -@@ -78,12 +78,14 @@ endif - endif - endif - --ifeq ($(OS_TARGET), Darwin) -+ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET))) - LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include -+ifeq ($(OS_TARGET), Darwin) - DEFINES += \ - -DGTEST_USE_OWN_TR1_TUPLE=1 \ - $(NULL) - endif -+endif - - ifeq ($(OS_TARGET), Linux) - LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_nicer.gyp b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_nicer.gyp deleted file mode 100644 index 20d6738e21b..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_nicer.gyp +++ /dev/null @@ -1,33 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nICEr_nicer.gyp,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nICEr/nicer.gyp.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nICEr/nicer.gyp -@@ -129,8 +129,19 @@ - ], - - 'conditions' : [ -- ## Mac -+ ## Mac and BSDs - [ 'OS == "mac"', { -+ 'defines' : [ -+ 'DARWIN', -+ 'HAVE_XLOCALE', -+ ], -+ }], -+ [ 'os_bsd == 1', { -+ 'defines' : [ -+ 'BSD', -+ ], -+ }], -+ [ 'OS == "mac" or os_bsd == 1', { - 'cflags_mozilla': [ - '-Wall', - '-Wno-parentheses', -@@ -138,7 +149,6 @@ - '-Wmissing-prototypes', - ], - 'defines' : [ -- 'DARWIN', - 'HAVE_LIBM=1', - 'HAVE_STRDUP=1', - 'HAVE_STRLCPY=1', diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_stun_addrs.c b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_stun_addrs.c deleted file mode 100644 index f56ce188c31..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_stun_addrs.c +++ /dev/null @@ -1,32 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nICEr_src_stun_addrs.c,v 1.4 2013/11/04 06:01:46 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nICEr/src/stun/addrs.c.orig 2013-10-29 01:21:03.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nICEr/src/stun/addrs.c -@@ -55,7 +55,9 @@ static char *RCSSTRING __UNUSED__="$Id: - #endif - #include <net/if.h> - #ifndef LINUX -+#if !defined(__OpenBSD__) && !defined(__NetBSD__) - #include <net/if_var.h> -+#endif - #include <net/if_dl.h> - #include <net/if_types.h> - #include <sys/sockio.h> -@@ -80,7 +82,7 @@ static char *RCSSTRING __UNUSED__="$Id: - - - --#ifdef DARWIN -+#if defined(BSD) || defined(DARWIN) - /* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. -@@ -695,7 +697,7 @@ nr_stun_get_addrs(nr_transport_addr addr - int _status=0; - int i; - --#ifdef DARWIN -+#if defined(BSD) || defined(DARWIN) - _status = stun_get_mib_addrs(addrs, maxaddrs, count); - #elif defined(WIN32) - _status = stun_get_win32_addrs(addrs, maxaddrs, count); diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_stun_stun.h b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_stun_stun.h deleted file mode 100644 index d474e9e1e42..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_stun_stun.h +++ /dev/null @@ -1,20 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nICEr_src_stun_stun.h,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nICEr/src/stun/stun.h.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nICEr/src/stun/stun.h -@@ -41,11 +41,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE - #include <sys/socket.h> - #include <net/if.h> - #ifndef LINUX -+#if !defined(__OpenBSD__) && !defined(__NetBSD__) - #include <net/if_var.h> -+#endif - #include <net/if_dl.h> - #include <net/if_types.h> - #endif -+#ifndef BSD - #include <net/route.h> -+#endif - #include <netinet/in.h> - #ifndef LINUX - #include <netinet/in_var.h> diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c deleted file mode 100644 index ef4ef1e665e..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c +++ /dev/null @@ -1,78 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c,v 1.2 2013/07/12 12:24:10 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c.orig 2013-06-20 04:35:15.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c -@@ -43,9 +43,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE - #include <locale.h> - #include <stdlib.h> - #include <wchar.h> --#ifdef DARWIN -+ -+#ifdef __FreeBSD__ -+#include <osreldate.h> -+# if __FreeBSD_version > 900505 -+# define HAVE_XLOCALE -+# endif -+#endif -+ -+#ifdef HAVE_XLOCALE - #include <xlocale.h> --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - - #include "nr_api.h" - #include "mbslen.h" -@@ -54,10 +62,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE - int - mbslen(const char *s, size_t *ncharsp) - { --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - static locale_t loc = 0; - static int initialized = 0; --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - #ifdef WIN32 - char *my_locale=0; - unsigned int i; -@@ -67,7 +75,7 @@ mbslen(const char *s, size_t *ncharsp) - int nchars; - mbstate_t mbs; - --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - if (! initialized) { - initialized = 1; - loc = newlocale(LC_CTYPE_MASK, "UTF-8", LC_GLOBAL_LOCALE); -@@ -76,7 +84,7 @@ mbslen(const char *s, size_t *ncharsp) - if (loc == 0) { - /* unable to create the UTF-8 locale */ - assert(loc != 0); /* should never happen */ --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - - #ifdef WIN32 - if (!setlocale(LC_CTYPE, 0)) -@@ -99,18 +107,18 @@ mbslen(const char *s, size_t *ncharsp) - ABORT(R_NOT_FOUND); - #endif - --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - } --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - - memset(&mbs, 0, sizeof(mbs)); - nchars = 0; - --#ifdef DARWIN -+#ifdef HAVE_XLOCALE - while (*s != '\0' && (nbytes = mbrlen_l(s, strlen(s), &mbs, loc)) != 0) - #else - while (*s != '\0' && (nbytes = mbrlen(s, strlen(s), &mbs)) != 0) --#endif /* DARWIN */ -+#endif /* HAVE_XLOCALE */ - { - if (nbytes == (size_t)-1) /* should never happen */ { - ABORT(R_INTERNAL); diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_nrappkit.gyp b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_nrappkit.gyp deleted file mode 100644 index 20d77fe3c7a..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_nrappkit.gyp +++ /dev/null @@ -1,32 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_nrappkit.gyp,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nrappkit/nrappkit.gyp.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nrappkit/nrappkit.gyp -@@ -147,8 +147,18 @@ - ], - - 'conditions' : [ -- ## Mac -+ ## Mac and BSDs - [ 'OS == "mac"', { -+ 'defines' : [ -+ 'DARWIN', -+ ], -+ }], -+ [ 'os_bsd == 1', { -+ 'defines' : [ -+ 'BSD', -+ ], -+ }], -+ [ 'OS == "mac" or os_bsd == 1', { - 'cflags_mozilla': [ - '-Wall', - '-Wno-parentheses', -@@ -156,7 +166,6 @@ - '-Wmissing-prototypes', - ], - 'defines' : [ -- 'DARWIN', - 'HAVE_LIBM=1', - 'HAVE_STRDUP=1', - 'HAVE_STRLCPY=1', diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_log_r__log.c b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_log_r__log.c deleted file mode 100644 index 8a2fbf4dfb6..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_log_r__log.c +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_src_log_r__log.c,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nrappkit/src/log/r_log.c.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nrappkit/src/log/r_log.c -@@ -48,6 +48,7 @@ static char *RCSSTRING __UNUSED__ ="$Id: - #include "hex.h" - - #include <string.h> -+#include <errno.h> - #ifndef _MSC_VER - #include <strings.h> - #include <syslog.h> diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h index d890ea52cc6..4b5a70be67b 100644 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h +++ b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h @@ -1,6 +1,6 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h,v 1.2 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h,v 1.3 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h.orig 2013-10-29 01:21:04.000000000 +0000 +--- mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h.orig 2013-12-11 04:28:54.000000000 +0000 +++ mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h @@ -30,12 +30,15 @@ * $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $ @@ -12,7 +12,7 @@ $NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_i +#elif !defined(_SYS_QUEUE_H_) #define _SYS_QUEUE_H_ --#ifndef DARWIN +-#if !defined(__FreeBSD__) && !defined(DARWIN) #include <stddef.h> -#define __offsetof offsetof + diff --git a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_util_util.c b/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_util_util.c deleted file mode 100644 index 1a522cbd7ec..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_util_util.c +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_src_util_util.c,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/mtransport/third_party/nrappkit/src/util/util.c.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/mtransport/third_party/nrappkit/src/util/util.c -@@ -45,6 +45,7 @@ static char *RCSSTRING __UNUSED__ ="$Id: - #include <dirent.h> - #endif - #include <string.h> -+#include <errno.h> - #include <ctype.h> - #include <sys/stat.h> - #ifdef OPENSSL diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_signaling.gyp b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_signaling.gyp index fa6481010ed..ee3071dbdea 100644 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_signaling.gyp +++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_signaling.gyp @@ -1,8 +1,8 @@ -$NetBSD: patch-mozilla_media_webrtc_signaling_signaling.gyp,v 1.1 2013/05/23 13:25:30 ryoon Exp $ +$NetBSD: patch-mozilla_media_webrtc_signaling_signaling.gyp,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/media/webrtc/signaling/signaling.gyp.orig 2013-05-03 03:08:06.000000000 +0000 +--- mozilla/media/webrtc/signaling/signaling.gyp.orig 2013-12-11 04:28:54.000000000 +0000 +++ mozilla/media/webrtc/signaling/signaling.gyp -@@ -217,6 +217,19 @@ +@@ -244,6 +244,19 @@ 'cflags_mozilla': [ ], }], @@ -22,28 +22,19 @@ $NetBSD: patch-mozilla_media_webrtc_signaling_signaling.gyp,v 1.1 2013/05/23 13: ['OS=="mac"', { 'include_dirs': [ ], -@@ -752,7 +765,7 @@ - ], - - }], -- ['OS=="mac"', { -+ ['OS=="mac" or os_bsd==1', { - - 'include_dirs': [ - ], -@@ -797,14 +810,13 @@ - - 'defines' : [ - 'SIP_OS_OSX', -- '_POSIX_SOURCE', -+ # using BSD extensions, leave _POSIX_SOURCE undefined - 'CPR_MEMORY_LITTLE_ENDIAN', - 'NO_SOCKET_POLLING', - 'USE_TIMER_SELECT_BASED', - 'FULL_BUILD', - 'STUBBED_OUT', - 'USE_PRINTF', -- '_DARWIN_C_SOURCE', - 'NO_NSPR_10_SUPPORT', - ], - +@@ -823,14 +836,13 @@ + ['OS=="mac"', { + 'defines' : [ + 'SIP_OS_OSX', +- '_POSIX_SOURCE', ++ # using BSD extensions, leave _POSIX_SOURCE undefined + 'CPR_MEMORY_LITTLE_ENDIAN', + 'NO_SOCKET_POLLING', + 'USE_TIMER_SELECT_BASED', + 'FULL_BUILD', + 'STUBBED_OUT', + 'USE_PRINTF', +- '_DARWIN_C_SOURCE', + 'NO_NSPR_10_SUPPORT', + ], + }], diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c deleted file mode 100644 index 53fc7418f3b..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c +++ /dev/null @@ -1,20 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c -@@ -322,11 +322,15 @@ cprGetMessage (cprMsgQueue_t msgQueue, b - cpr_msgq_node_t *node; - struct timespec timeout; - struct timeval tv; -+#ifndef __APPLE__ -+ struct timezone tz; -+#else - // On the iPhone, there is a DarwinAlias problem with "timezone" - struct _timezone { - int tz_minuteswest; /* of Greenwich */ - int tz_dsttime; /* type of dst correction to apply */ - } tz; -+#endif - - /* Initialize ppUserData */ - if (ppUserData) { diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_Makefile.in b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_Makefile.in index b2e88c6e8fe..3ede53aea5a 100644 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_Makefile.in +++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_Makefile.in @@ -1,8 +1,8 @@ -$NetBSD: patch-mozilla_media_webrtc_signaling_test_Makefile.in,v 1.1 2013/05/23 13:25:30 ryoon Exp $ +$NetBSD: patch-mozilla_media_webrtc_signaling_test_Makefile.in,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/media/webrtc/signaling/test/Makefile.in.orig 2013-05-03 03:08:06.000000000 +0000 +--- mozilla/media/webrtc/signaling/test/Makefile.in.orig 2013-12-11 04:28:55.000000000 +0000 +++ mozilla/media/webrtc/signaling/test/Makefile.in -@@ -17,6 +17,7 @@ LIBS = \ +@@ -7,6 +7,7 @@ LIBS = \ $(NSPR_LIBS) \ $(NSS_LIBS) \ $(REALTIME_LIBS) \ @@ -10,12 +10,3 @@ $NetBSD: patch-mozilla_media_webrtc_signaling_test_Makefile.in,v 1.1 2013/05/23 $(DEPTH)/xpcom/glue/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \ $(DEPTH)/media/mtransport/standalone/$(LIB_PREFIX)mtransport_s.$(LIB_SUFFIX) \ $(DEPTH)/media/webrtc/signalingtest/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \ -@@ -86,7 +87,7 @@ LIBS += \ - $(NULL) - endif - --ifeq ($(OS_TARGET),Linux) -+ifneq (,$(filter Linux DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET))) - LIBS += \ - $(MOZ_CAIRO_OSLIBS) \ - $(NULL) diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_build_build__config.h b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_build_build__config.h deleted file mode 100644 index 05b0d205590..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_build_build__config.h +++ /dev/null @@ -1,41 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_build_build__config.h,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/build/build_config.h.orig 2013-09-16 18:26:50.000000000 +0000 -+++ mozilla/media/webrtc/trunk/build/build_config.h -@@ -37,9 +37,15 @@ - #elif defined(_WIN32) - #define OS_WIN 1 - #define TOOLKIT_VIEWS 1 --#elif defined(__FreeBSD__) -+#elif defined(__DragonFly__) -+#define OS_DRAGONFLY 1 -+#define TOOLKIT_GTK -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - #define OS_FREEBSD 1 - #define TOOLKIT_GTK -+#elif defined(__NetBSD__) -+#define OS_NETBSD 1 -+#define TOOLKIT_GTK - #elif defined(__OpenBSD__) - #define OS_OPENBSD 1 - #define TOOLKIT_GTK -@@ -56,15 +62,15 @@ - - // For access to standard BSD features, use OS_BSD instead of a - // more specific macro. --#if defined(OS_FREEBSD) || defined(OS_OPENBSD) -+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \ -+ || defined(OS_NETBSD) || defined(OS_OPENBSD) - #define OS_BSD 1 - #endif - - // For access to standard POSIXish features, use OS_POSIX instead of a - // more specific macro. --#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ -- defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \ -- defined(OS_NACL) -+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \ -+ defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL) - #define OS_POSIX 1 - #endif - diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py deleted file mode 100644 index f96f2c435dd..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py +++ /dev/null @@ -1,55 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py,v 1.1 2013/05/23 13:25:30 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py.orig 2013-05-03 03:08:06.000000000 +0000 -+++ mozilla/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py -@@ -9,6 +9,7 @@ import collections - import gyp - import gyp.common - import sys -+import platform - import os - import re - import shlex -@@ -111,20 +112,34 @@ def ensure_directory_exists(path): - - def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" -+ system = platform.system().lower() - flavors = { -- 'win32': 'win', -- 'darwin': 'mac', -- 'sunos5': 'solaris', -- 'freebsd7': 'freebsd', -- 'freebsd8': 'freebsd', -+ 'microsoft': 'win', -+ 'windows' : 'win', -+ 'darwin' : 'mac', -+ 'sunos' : 'solaris', -+ 'dragonfly': 'bsd', -+ 'freebsd' : 'bsd', -+ 'netbsd' : 'bsd', -+ 'openbsd' : 'bsd', - } -- flavor = flavors.get(sys.platform, 'linux') -- return params.get('flavor', flavor) -+ -+ if 'flavor' in params: -+ return params['flavor'] -+ if system.startswith('cygwin'): -+ return 'win' -+ if system in flavors: -+ return flavors[system] -+ -+ return 'linux' - - - def CalculateVariables(default_variables, params): -+ flavor = GetFlavor(params) -+ if flavor == 'bsd': -+ flavor = platform.system().lower() - generator_flags = params.get('generator_flags', {}) -- default_variables['OS'] = generator_flags.get('os', GetFlavor(params)) -+ default_variables['OS'] = generator_flags.get('os', flavor) - - - def CalculateGeneratorInputInfo(params): diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi index a55b45bcfac..9600aa70152 100644 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi +++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi @@ -1,9 +1,9 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi,v 1.3 2013/09/28 14:37:05 ryoon Exp $ +$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi,v 1.4 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/media/webrtc/trunk/webrtc/build/common.gypi.orig 2013-09-16 18:26:50.000000000 +0000 +--- mozilla/media/webrtc/trunk/webrtc/build/common.gypi.orig 2013-12-11 04:28:56.000000000 +0000 +++ mozilla/media/webrtc/trunk/webrtc/build/common.gypi -@@ -71,9 +71,9 @@ - 'enable_data_logging%': 0, +@@ -78,9 +78,9 @@ + 'enable_protobuf%': 1, # Disable these to not build components which can be externally provided. - 'build_libjpeg%': 1, @@ -14,7 +14,7 @@ $NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi,v 1.3 2013/09 # Enable to use the Mozilla internal settings. 'build_with_mozilla%': 0, -@@ -238,7 +238,7 @@ +@@ -241,7 +241,7 @@ }], ['OS=="dragonfly" or OS=="netbsd"', { 'defines': [ diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc deleted file mode 100644 index 7f80b9aad3f..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc +++ /dev/null @@ -1,71 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc.orig 2013-09-16 18:26:51.000000000 +0000 -+++ mozilla/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc -@@ -16,7 +16,9 @@ - #include <assert.h> - #include <string.h> - --#if defined(_WIN32) -+#if defined(WEBRTC_DUMMY_AUDIO_BUILD) -+// do not include platform specific headers -+#elif defined(_WIN32) - #include "audio_device_utility_win.h" - #include "audio_device_wave_win.h" - #if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) -@@ -32,14 +34,8 @@ - #include <stdlib.h> - #include "audio_device_utility_android.h" - #include "audio_device_jni_android.h" --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - #include "audio_device_utility_linux.h" -- #if defined(LINUX_ALSA) -- #include "audio_device_alsa_linux.h" -- #endif -- #if defined(LINUX_PULSE) -- #include "audio_device_pulse_linux.h" -- #endif - #elif defined(WEBRTC_IOS) - #include "audio_device_utility_ios.h" - #include "audio_device_ios.h" -@@ -47,6 +43,12 @@ - #include "audio_device_utility_mac.h" - #include "audio_device_mac.h" - #endif -+#if defined(LINUX_ALSA) -+ #include "audio_device_alsa_linux.h" -+#endif -+#if defined(LINUX_PULSE) -+ #include "audio_device_pulse_linux.h" -+#endif - #include "audio_device_dummy.h" - #include "audio_device_utility_dummy.h" - #include "critical_section_wrapper.h" -@@ -161,7 +163,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Che - #elif defined(WEBRTC_ANDROID) - platform = kPlatformAndroid; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is ANDROID"); --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - platform = kPlatformLinux; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX"); - #elif defined(WEBRTC_IOS) -@@ -301,7 +303,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Cre - - // Create the *Linux* implementation of the Audio Device - // --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - if ((audioLayer == kLinuxPulseAudio) || (audioLayer == kPlatformDefaultAudio)) - { - #if defined(LINUX_PULSE) -@@ -347,7 +349,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Cre - // - ptrAudioDeviceUtility = new AudioDeviceUtilityLinux(Id()); - } --#endif // #if defined(WEBRTC_LINUX) -+#endif // #if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - - // Create the *iPhone* implementation of the Audio Device - // diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc deleted file mode 100644 index b62262b7b5c..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc +++ /dev/null @@ -1,31 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc,v 1.2 2013/11/04 06:01:46 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc.orig 2013-10-29 01:21:05.000000000 +0000 -+++ mozilla/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc -@@ -196,7 +196,7 @@ class AudioDeviceAPITest: public testing - // Create default implementation instance - EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( - kId, AudioDeviceModule::kPlatformDefaultAudio)) != NULL); --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) - EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( - kId, AudioDeviceModule::kWindowsWaveAudio)) == NULL); - EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( -@@ -1689,7 +1689,7 @@ TEST_F(AudioDeviceAPITest, CPULoad) { - - // TODO(kjellander): Fix flakiness causing failures on Windows. - // TODO(phoglund): Fix flakiness causing failures on Linux. --#if !defined(_WIN32) && !defined(WEBRTC_LINUX) -+#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD) - TEST_F(AudioDeviceAPITest, StartAndStopRawOutputFileRecording) { - // NOTE: this API is better tested in a functional test - CheckInitialPlayoutStates(); -@@ -1758,7 +1758,7 @@ TEST_F(AudioDeviceAPITest, StartAndStopR - // - size of raw_input_not_recording.pcm shall be 0 - // - size of raw_input_not_recording.pcm shall be > 0 - } --#endif // !WIN32 && !WEBRTC_LINUX -+#endif // !WIN32 && !WEBRTC_LINUX && !defined(WEBRTC_BSD) - - TEST_F(AudioDeviceAPITest, RecordingSampleRate) { - uint32_t sampleRate(0); diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc deleted file mode 100644 index f6a48ad4c75..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc,v 1.1 2013/07/12 12:24:10 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture_factory.cc.orig 2013-06-20 04:35:16.000000000 +0000 -+++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture_factory.cc -@@ -8,8 +8,10 @@ - * be found in the AUTHORS file in the root of the source tree. - */ - -+_Pragma("GCC visibility push(default)") - #include "video_capture_factory.h" - #include "video_capture_impl.h" -+_Pragma("GCC visibility pop") - - namespace webrtc - { diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_clock.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_clock.cc new file mode 100644 index 00000000000..48b21b6622a --- /dev/null +++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_clock.cc @@ -0,0 +1,31 @@ +$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_clock.cc,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/clock.cc.orig 2013-12-11 04:28:57.000000000 +0000 ++++ mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/clock.cc +@@ -15,7 +15,7 @@ + #include <Windows.h> + #include <WinSock.h> + #include <MMSystem.h> +-#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_MAC)) ++#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC)) + #include <sys/time.h> + #include <time.h> + #endif +@@ -209,7 +209,7 @@ class WindowsRealTimeClock : public Real + WindowsHelpTimer* _helpTimer; + }; + +-#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_MAC)) ++#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC)) + class UnixRealTimeClock : public RealTimeClock { + public: + UnixRealTimeClock() {} +@@ -240,7 +240,7 @@ Clock* Clock::GetRealTimeClock() { + #if defined(_WIN32) + static WindowsRealTimeClock clock(&global_help_timer); + return &clock; +-#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) ++#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC)) + static UnixRealTimeClock clock; + return &clock; + #else diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc deleted file mode 100644 index d7f07894966..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc,v 1.3 2013/11/04 06:01:46 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc.orig 2013-10-29 01:21:06.000000000 +0000 -+++ mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc -@@ -17,6 +17,8 @@ - #elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) - #include <pthread.h> - #include "webrtc/system_wrappers/source/condition_variable_posix.h" -+#else -+#include <stddef.h> // for NULL - #endif - - namespace webrtc { diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp index 206e5aaa83e..91c37d5ca5f 100644 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp +++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp @@ -1,18 +1,3388 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp,v 1.1 2013/05/23 13:25:30 ryoon Exp $ +$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp.orig 2013-05-03 03:08:07.000000000 +0000 +--- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp.orig 2013-12-11 04:28:57.000000000 +0000 +++ mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp -@@ -21,6 +21,13 @@ Scott McMurray
- #include "constants.hpp"
- #include <cstring>
-
-+#ifdef __FreeBSD__
-+# include <osreldate.h>
-+# if __FreeBSD_version < 900506
-+# define getchar boost_getchar
-+# endif
-+#endif
-+
- namespace boost {
- namespace detail {
- //This only works on unsigned data types
+@@ -1,1688 +1,1695 @@ +-//Templated spread_sort library
+-
+-// Copyright Steven J. Ross 2001 - 2009.
+-// Distributed under the Boost Software License, Version 1.0.
+-// (See accompanying file LICENSE_1_0.txt or copy at
+-// http://www.boost.org/LICENSE_1_0.txt)
+-
+-// See http://www.boost.org/ for updates, documentation, and revision history.
+-
+-/*
+-Some improvements suggested by:
+-Phil Endecott and Frank Gennari
+-Cygwin fix provided by:
+-Scott McMurray
+-*/
+-
+-#ifndef BOOST_SPREAD_SORT_H
+-#define BOOST_SPREAD_SORT_H
+-#include <algorithm>
+-#include <cstring>
+-#include <vector>
+-#include "webrtc/system_wrappers/source/spreadsortlib/constants.hpp"
+-
+-namespace boost {
+- namespace detail {
+- //This only works on unsigned data types
+- template <typename T>
+- inline unsigned
+- rough_log_2_size(const T& input)
+- {
+- unsigned result = 0;
+- //The && is necessary on some compilers to avoid infinite loops; it doesn't significantly impair performance
+- while((input >> result) && (result < (8*sizeof(T)))) ++result;
+- return result;
+- }
+-
+- //Gets the maximum size which we'll call spread_sort on to control worst-case performance
+- //Maintains both a minimum size to recurse and a check of distribution size versus count
+- //This is called for a set of bins, instead of bin-by-bin, to avoid performance overhead
+- inline size_t
+- get_max_count(unsigned log_range, size_t count)
+- {
+- unsigned divisor = rough_log_2_size(count);
+- //Making sure the divisor is positive
+- if(divisor > LOG_MEAN_BIN_SIZE)
+- divisor -= LOG_MEAN_BIN_SIZE;
+- else
+- divisor = 1;
+- unsigned relative_width = (LOG_CONST * log_range)/((divisor > MAX_SPLITS) ? MAX_SPLITS : divisor);
+- //Don't try to bitshift more than the size of an element
+- if((8*sizeof(size_t)) <= relative_width)
+- relative_width = (8*sizeof(size_t)) - 1;
+- return (size_t)1 << ((relative_width < (LOG_MEAN_BIN_SIZE + LOG_MIN_SPLIT_COUNT)) ?
+- (LOG_MEAN_BIN_SIZE + LOG_MIN_SPLIT_COUNT) : relative_width);
+- }
+-
+- //Find the minimum and maximum using <
+- template <class RandomAccessIter>
+- inline void
+- find_extremes(RandomAccessIter current, RandomAccessIter last, RandomAccessIter & max, RandomAccessIter & min)
+- {
+- min = max = current;
+- //Start from the second item, as max and min are initialized to the first
+- while(++current < last) {
+- if(*max < *current)
+- max = current;
+- else if(*current < *min)
+- min = current;
+- }
+- }
+-
+- //Uses a user-defined comparison operator to find minimum and maximum
+- template <class RandomAccessIter, class compare>
+- inline void
+- find_extremes(RandomAccessIter current, RandomAccessIter last, RandomAccessIter & max, RandomAccessIter & min, compare comp)
+- {
+- min = max = current;
+- while(++current < last) {
+- if(comp(*max, *current))
+- max = current;
+- else if(comp(*current, *min))
+- min = current;
+- }
+- }
+-
+- //Gets a non-negative right bit shift to operate as a logarithmic divisor
+- inline int
+- get_log_divisor(size_t count, unsigned log_range)
+- {
+- int log_divisor;
+- //If we can finish in one iteration without exceeding either (2 to the MAX_SPLITS) or n bins, do so
+- if((log_divisor = log_range - rough_log_2_size(count)) <= 0 && log_range < MAX_SPLITS)
+- log_divisor = 0;
+- else {
+- //otherwise divide the data into an optimized number of pieces
+- log_divisor += LOG_MEAN_BIN_SIZE;
+- if(log_divisor < 0)
+- log_divisor = 0;
+- //Cannot exceed MAX_SPLITS or cache misses slow down bin lookups dramatically
+- if((log_range - log_divisor) > MAX_SPLITS)
+- log_divisor = log_range - MAX_SPLITS;
+- }
+- return log_divisor;
+- }
+-
+- template <class RandomAccessIter>
+- inline RandomAccessIter *
+- size_bins(std::vector<size_t> &bin_sizes, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset, unsigned &cache_end, unsigned bin_count)
+- {
+- //Assure space for the size of each bin, followed by initializing sizes
+- if(bin_count > bin_sizes.size())
+- bin_sizes.resize(bin_count);
+- for(size_t u = 0; u < bin_count; u++)
+- bin_sizes[u] = 0;
+- //Make sure there is space for the bins
+- cache_end = cache_offset + bin_count;
+- if(cache_end > bin_cache.size())
+- bin_cache.resize(cache_end);
+- return &(bin_cache[cache_offset]);
+- }
+-
+- //Implementation for recursive integer sorting
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void
+- spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes)
+- {
+- //This step is roughly 10% of runtime, but it helps avoid worst-case behavior and improve behavior with real data
+- //If you know the maximum and minimum ahead of time, you can pass those values in and skip this step for the first iteration
+- RandomAccessIter max, min;
+- find_extremes(first, last, max, min);
+- //max and min will be the same (the first item) iff all values are equivalent
+- if(max == min)
+- return;
+- RandomAccessIter * target_bin;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(*max >> 0) - (*min >> 0)));
+- div_type div_min = *min >> log_divisor;
+- div_type div_max = *max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin; this takes roughly 10% of runtime
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[(*(current++) >> log_divisor) - div_min]++;
+- //Assign the bin positions
+- bins[0] = first;
+- for(unsigned u = 0; u < bin_count - 1; u++)
+- bins[u + 1] = bins[u] + bin_sizes[u];
+-
+- //Swap into place
+- //This dominates runtime, mostly in the swap and bin lookups
+- RandomAccessIter nextbinstart = first;
+- for(unsigned u = 0; u < bin_count - 1; ++u) {
+- RandomAccessIter * local_bin = bins + u;
+- nextbinstart += bin_sizes[u];
+- //Iterating over each element in this bin
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //Swapping elements in current into place until the correct element has been swapped in
+- for(target_bin = (bins + ((*current >> log_divisor) - div_min)); target_bin != local_bin;
+- target_bin = bins + ((*current >> log_divisor) - div_min)) {
+- //3-way swap; this is about 1% faster than a 2-way swap with integers
+- //The main advantage is less copies are involved per item put in the correct place
+- data_type tmp;
+- RandomAccessIter b = (*target_bin)++;
+- RandomAccessIter * b_bin = bins + ((*b >> log_divisor) - div_min);
+- if (b_bin != local_bin) {
+- RandomAccessIter c = (*b_bin)++;
+- tmp = *c;
+- *c = *b;
+- }
+- else
+- tmp = *b;
+- *b = *current;
+- *current = tmp;
+- }
+- }
+- *local_bin = nextbinstart;
+- }
+- bins[bin_count - 1] = last;
+-
+- //If we've bucketsorted, the array is sorted and we should skip recursion
+- if(!log_divisor)
+- return;
+-
+- //Recursing; log_divisor is the remaining range
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- //don't sort unless there are at least two items to compare
+- if(count < 2)
+- continue;
+- //using std::sort if its worst-case is better
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u]);
+- else
+- spread_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes);
+- }
+- }
+-
+- //Generic bitshift-based 3-way swapping code
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void inner_swap_loop(RandomAccessIter * bins, const RandomAccessIter & nextbinstart, unsigned ii, right_shift &shift
+- , const unsigned log_divisor, const div_type div_min)
+- {
+- RandomAccessIter * local_bin = bins + ii;
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- for(RandomAccessIter * target_bin = (bins + (shift(*current, log_divisor) - div_min)); target_bin != local_bin;
+- target_bin = bins + (shift(*current, log_divisor) - div_min)) {
+- data_type tmp;
+- RandomAccessIter b = (*target_bin)++;
+- RandomAccessIter * b_bin = bins + (shift(*b, log_divisor) - div_min);
+- //Three-way swap; if the item to be swapped doesn't belong in the current bin, swap it to where it belongs
+- if (b_bin != local_bin) {
+- RandomAccessIter c = (*b_bin)++;
+- tmp = *c;
+- *c = *b;
+- }
+- //Note: we could increment current once the swap is done in this case, but that seems to impair performance
+- else
+- tmp = *b;
+- *b = *current;
+- *current = tmp;
+- }
+- }
+- *local_bin = nextbinstart;
+- }
+-
+- //Standard swapping wrapper for ascending values
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void swap_loop(RandomAccessIter * bins, RandomAccessIter & nextbinstart, unsigned ii, right_shift &shift
+- , const std::vector<size_t> &bin_sizes, const unsigned log_divisor, const div_type div_min)
+- {
+- nextbinstart += bin_sizes[ii];
+- inner_swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, log_divisor, div_min);
+- }
+-
+- //Functor implementation for recursive sorting
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare>
+- inline void
+- spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes, right_shift shift, compare comp)
+- {
+- RandomAccessIter max, min;
+- find_extremes(first, last, max, min, comp);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(shift(*max, 0)) - (shift(*min, 0))));
+- div_type div_min = shift(*min, log_divisor);
+- div_type div_max = shift(*max, log_divisor);
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[shift(*(current++), log_divisor) - div_min]++;
+- bins[0] = first;
+- for(unsigned u = 0; u < bin_count - 1; u++)
+- bins[u + 1] = bins[u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- for(unsigned u = 0; u < bin_count - 1; ++u)
+- swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, u, shift, bin_sizes, log_divisor, div_min);
+- bins[bin_count - 1] = last;
+-
+- //If we've bucketsorted, the array is sorted and we should skip recursion
+- if(!log_divisor)
+- return;
+-
+- //Recursing
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u], comp);
+- else
+- spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift, compare>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift, comp);
+- }
+- }
+-
+- //Functor implementation for recursive sorting with only Shift overridden
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void
+- spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes, right_shift shift)
+- {
+- RandomAccessIter max, min;
+- find_extremes(first, last, max, min);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(shift(*max, 0)) - (shift(*min, 0))));
+- div_type div_min = shift(*min, log_divisor);
+- div_type div_max = shift(*max, log_divisor);
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[shift(*(current++), log_divisor) - div_min]++;
+- bins[0] = first;
+- for(unsigned u = 0; u < bin_count - 1; u++)
+- bins[u + 1] = bins[u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- for(unsigned ii = 0; ii < bin_count - 1; ++ii)
+- swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min);
+- bins[bin_count - 1] = last;
+-
+- //If we've bucketsorted, the array is sorted and we should skip recursion
+- if(!log_divisor)
+- return;
+-
+- //Recursing
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u]);
+- else
+- spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift);
+- }
+- }
+-
+- //Holds the bin vector and makes the initial recursive call
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void
+- spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- spread_sort_rec<RandomAccessIter, div_type, data_type>(first, last, bin_cache, 0, bin_sizes);
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare>
+- inline void
+- spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift, compare comp)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift, compare>(first, last, bin_cache, 0, bin_sizes, shift, comp);
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void
+- spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(first, last, bin_cache, 0, bin_sizes, shift);
+- }
+- }
+-
+- //Top-level sorting call for integers
+- template <class RandomAccessIter>
+- inline void integer_sort(RandomAccessIter first, RandomAccessIter last)
+- {
+- //Don't sort if it's too small to optimize
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last);
+- else
+- detail::spread_sort(first, last, *first >> 0, *first);
+- }
+-
+- //integer_sort with functors
+- template <class RandomAccessIter, class right_shift, class compare>
+- inline void integer_sort(RandomAccessIter first, RandomAccessIter last,
+- right_shift shift, compare comp) {
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last, comp);
+- else
+- detail::spread_sort(first, last, shift(*first, 0), *first, shift, comp);
+- }
+-
+- //integer_sort with right_shift functor
+- template <class RandomAccessIter, class right_shift>
+- inline void integer_sort(RandomAccessIter first, RandomAccessIter last,
+- right_shift shift) {
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last);
+- else
+- detail::spread_sort(first, last, shift(*first, 0), *first, shift);
+- }
+-
+- //------------------------------------------------------ float_sort source --------------------------------------
+- //Casts a RandomAccessIter to the specified data type
+- template<class cast_type, class RandomAccessIter>
+- inline cast_type
+- cast_float_iter(const RandomAccessIter & floatiter)
+- {
+- cast_type result;
+- std::memcpy(&result, &(*floatiter), sizeof(cast_type));
+- return result;
+- }
+-
+- //Casts a data element to the specified datinner_float_a type
+- template<class data_type, class cast_type>
+- inline cast_type
+- mem_cast(const data_type & data)
+- {
+- cast_type result;
+- std::memcpy(&result, &data, sizeof(cast_type));
+- return result;
+- }
+-
+- namespace detail {
+- template <class RandomAccessIter, class div_type, class right_shift>
+- inline void
+- find_extremes(RandomAccessIter current, RandomAccessIter last, div_type & max, div_type & min, right_shift shift)
+- {
+- min = max = shift(*current, 0);
+- while(++current < last) {
+- div_type value = shift(*current, 0);
+- if(max < value)
+- max = value;
+- else if(value < min)
+- min = value;
+- }
+- }
+-
+- //Specialized swap loops for floating-point casting
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void inner_float_swap_loop(RandomAccessIter * bins, const RandomAccessIter & nextbinstart, unsigned ii
+- , const unsigned log_divisor, const div_type div_min)
+- {
+- RandomAccessIter * local_bin = bins + ii;
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- for(RandomAccessIter * target_bin = (bins + ((cast_float_iter<div_type, RandomAccessIter>(current) >> log_divisor) - div_min)); target_bin != local_bin;
+- target_bin = bins + ((cast_float_iter<div_type, RandomAccessIter>(current) >> log_divisor) - div_min)) {
+- data_type tmp;
+- RandomAccessIter b = (*target_bin)++;
+- RandomAccessIter * b_bin = bins + ((cast_float_iter<div_type, RandomAccessIter>(b) >> log_divisor) - div_min);
+- //Three-way swap; if the item to be swapped doesn't belong in the current bin, swap it to where it belongs
+- if (b_bin != local_bin) {
+- RandomAccessIter c = (*b_bin)++;
+- tmp = *c;
+- *c = *b;
+- }
+- else
+- tmp = *b;
+- *b = *current;
+- *current = tmp;
+- }
+- }
+- *local_bin = nextbinstart;
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void float_swap_loop(RandomAccessIter * bins, RandomAccessIter & nextbinstart, unsigned ii
+- , const std::vector<size_t> &bin_sizes, const unsigned log_divisor, const div_type div_min)
+- {
+- nextbinstart += bin_sizes[ii];
+- inner_float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, ii, log_divisor, div_min);
+- }
+-
+- template <class RandomAccessIter, class cast_type>
+- inline void
+- find_extremes(RandomAccessIter current, RandomAccessIter last, cast_type & max, cast_type & min)
+- {
+- min = max = cast_float_iter<cast_type, RandomAccessIter>(current);
+- while(++current < last) {
+- cast_type value = cast_float_iter<cast_type, RandomAccessIter>(current);
+- if(max < value)
+- max = value;
+- else if(value < min)
+- min = value;
+- }
+- }
+-
+- //Special-case sorting of positive floats with casting instead of a right_shift
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void
+- positive_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[(cast_float_iter<div_type, RandomAccessIter>(current++) >> log_divisor) - div_min]++;
+- bins[0] = first;
+- for(unsigned u = 0; u < bin_count - 1; u++)
+- bins[u + 1] = bins[u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- for(unsigned u = 0; u < bin_count - 1; ++u)
+- float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, u, bin_sizes, log_divisor, div_min);
+- bins[bin_count - 1] = last;
+-
+- //Return if we've completed bucketsorting
+- if(!log_divisor)
+- return;
+-
+- //Recursing
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u]);
+- else
+- positive_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes);
+- }
+- }
+-
+- //Sorting negative_ float_s
+- //Note that bins are iterated in reverse order because max_neg_float = min_neg_int
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void
+- negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[(cast_float_iter<div_type, RandomAccessIter>(current++) >> log_divisor) - div_min]++;
+- bins[bin_count - 1] = first;
+- for(int ii = bin_count - 2; ii >= 0; --ii)
+- bins[ii] = bins[ii + 1] + bin_sizes[ii + 1];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- //The last bin will always have the correct elements in it
+- for(int ii = bin_count - 1; ii > 0; --ii)
+- float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, ii, bin_sizes, log_divisor, div_min);
+- //Since we don't process the last bin, we need to update its end position
+- bin_cache[cache_offset] = last;
+-
+- //Return if we've completed bucketsorting
+- if(!log_divisor)
+- return;
+-
+- //Recursing
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) {
+- size_t count = bin_cache[ii] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[ii]);
+- else
+- negative_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes);
+- }
+- }
+-
+- //Sorting negative_ float_s
+- //Note that bins are iterated in reverse order because max_neg_float = min_neg_int
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void
+- negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes, right_shift shift)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min, shift);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[shift(*(current++), log_divisor) - div_min]++;
+- bins[bin_count - 1] = first;
+- for(int ii = bin_count - 2; ii >= 0; --ii)
+- bins[ii] = bins[ii + 1] + bin_sizes[ii + 1];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- //The last bin will always have the correct elements in it
+- for(int ii = bin_count - 1; ii > 0; --ii)
+- swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min);
+- //Since we don't process the last bin, we need to update its end position
+- bin_cache[cache_offset] = last;
+-
+- //Return if we've completed bucketsorting
+- if(!log_divisor)
+- return;
+-
+- //Recursing
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) {
+- size_t count = bin_cache[ii] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[ii]);
+- else
+- negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift);
+- }
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare>
+- inline void
+- negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes, right_shift shift, compare comp)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min, shift);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[shift(*(current++), log_divisor) - div_min]++;
+- bins[bin_count - 1] = first;
+- for(int ii = bin_count - 2; ii >= 0; --ii)
+- bins[ii] = bins[ii + 1] + bin_sizes[ii + 1];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- //The last bin will always have the correct elements in it
+- for(int ii = bin_count - 1; ii > 0; --ii)
+- swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min);
+- //Since we don't process the last bin, we need to update its end position
+- bin_cache[cache_offset] = last;
+-
+- //Return if we've completed bucketsorting
+- if(!log_divisor)
+- return;
+-
+- //Recursing
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) {
+- size_t count = bin_cache[ii] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[ii], comp);
+- else
+- negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift, compare>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift, comp);
+- }
+- }
+-
+- //Casting special-case for floating-point sorting
+- template <class RandomAccessIter, class div_type, class data_type>
+- inline void
+- float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[(cast_float_iter<div_type, RandomAccessIter>(current++) >> log_divisor) - div_min]++;
+- //The index of the first positive bin
+- div_type first_positive = (div_min < 0) ? -div_min : 0;
+- //Resetting if all bins are negative
+- if(cache_offset + first_positive > cache_end)
+- first_positive = cache_end - cache_offset;
+- //Reversing the order of the negative bins
+- //Note that because of the negative/positive ordering direction flip
+- //We can not depend upon bin order and positions matching up
+- //so bin_sizes must be reused to contain the end of the bin
+- if(first_positive > 0) {
+- bins[first_positive - 1] = first;
+- for(int ii = first_positive - 2; ii >= 0; --ii) {
+- bins[ii] = first + bin_sizes[ii + 1];
+- bin_sizes[ii] += bin_sizes[ii + 1];
+- }
+- //Handling positives following negatives
+- if((unsigned)first_positive < bin_count) {
+- bins[first_positive] = first + bin_sizes[0];
+- bin_sizes[first_positive] += bin_sizes[0];
+- }
+- }
+- else
+- bins[0] = first;
+- for(unsigned u = first_positive; u < bin_count - 1; u++) {
+- bins[u + 1] = first + bin_sizes[u];
+- bin_sizes[u + 1] += bin_sizes[u];
+- }
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- for(unsigned u = 0; u < bin_count; ++u) {
+- nextbinstart = first + bin_sizes[u];
+- inner_float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, u, log_divisor, div_min);
+- }
+-
+- if(!log_divisor)
+- return;
+-
+- //Handling negative values first
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) {
+- size_t count = bin_cache[ii] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[ii]);
+- //sort negative values using reversed-bin spread_sort
+- else
+- negative_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes);
+- }
+-
+- for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u]);
+- //sort positive values using normal spread_sort
+- else
+- positive_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes);
+- }
+- }
+-
+- //Functor implementation for recursive sorting
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void
+- float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes, right_shift shift)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min, shift);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[shift(*(current++), log_divisor) - div_min]++;
+- //The index of the first positive bin
+- div_type first_positive = (div_min < 0) ? -div_min : 0;
+- //Resetting if all bins are negative
+- if(cache_offset + first_positive > cache_end)
+- first_positive = cache_end - cache_offset;
+- //Reversing the order of the negative bins
+- //Note that because of the negative/positive ordering direction flip
+- //We can not depend upon bin order and positions matching up
+- //so bin_sizes must be reused to contain the end of the bin
+- if(first_positive > 0) {
+- bins[first_positive - 1] = first;
+- for(int ii = first_positive - 2; ii >= 0; --ii) {
+- bins[ii] = first + bin_sizes[ii + 1];
+- bin_sizes[ii] += bin_sizes[ii + 1];
+- }
+- //Handling positives following negatives
+- if((unsigned)first_positive < bin_count) {
+- bins[first_positive] = first + bin_sizes[0];
+- bin_sizes[first_positive] += bin_sizes[0];
+- }
+- }
+- else
+- bins[0] = first;
+- for(unsigned u = first_positive; u < bin_count - 1; u++) {
+- bins[u + 1] = first + bin_sizes[u];
+- bin_sizes[u + 1] += bin_sizes[u];
+- }
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- for(unsigned u = 0; u < bin_count; ++u) {
+- nextbinstart = first + bin_sizes[u];
+- inner_swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, u, shift, log_divisor, div_min);
+- }
+-
+- //Return if we've completed bucketsorting
+- if(!log_divisor)
+- return;
+-
+- //Handling negative values first
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) {
+- size_t count = bin_cache[ii] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[ii]);
+- //sort negative values using reversed-bin spread_sort
+- else
+- negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift);
+- }
+-
+- for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u]);
+- //sort positive values using normal spread_sort
+- else
+- spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift);
+- }
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare>
+- inline void
+- float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset
+- , std::vector<size_t> &bin_sizes, right_shift shift, compare comp)
+- {
+- div_type max, min;
+- find_extremes(first, last, max, min, shift);
+- if(max == min)
+- return;
+- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min));
+- div_type div_min = min >> log_divisor;
+- div_type div_max = max >> log_divisor;
+- unsigned bin_count = div_max - div_min + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count);
+-
+- //Calculating the size of each bin
+- for (RandomAccessIter current = first; current != last;)
+- bin_sizes[shift(*(current++), log_divisor) - div_min]++;
+- //The index of the first positive bin
+- div_type first_positive = (div_min < 0) ? -div_min : 0;
+- //Resetting if all bins are negative
+- if(cache_offset + first_positive > cache_end)
+- first_positive = cache_end - cache_offset;
+- //Reversing the order of the negative bins
+- //Note that because of the negative/positive ordering direction flip
+- //We can not depend upon bin order and positions matching up
+- //so bin_sizes must be reused to contain the end of the bin
+- if(first_positive > 0) {
+- bins[first_positive - 1] = first;
+- for(int ii = first_positive - 2; ii >= 0; --ii) {
+- bins[ii] = first + bin_sizes[ii + 1];
+- bin_sizes[ii] += bin_sizes[ii + 1];
+- }
+- //Handling positives following negatives
+- if((unsigned)first_positive < bin_count) {
+- bins[first_positive] = first + bin_sizes[0];
+- bin_sizes[first_positive] += bin_sizes[0];
+- }
+- }
+- else
+- bins[0] = first;
+- for(unsigned u = first_positive; u < bin_count - 1; u++) {
+- bins[u + 1] = first + bin_sizes[u];
+- bin_sizes[u + 1] += bin_sizes[u];
+- }
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- for(unsigned u = 0; u < bin_count; ++u) {
+- nextbinstart = first + bin_sizes[u];
+- inner_swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, u, shift, log_divisor, div_min);
+- }
+-
+- //Return if we've completed bucketsorting
+- if(!log_divisor)
+- return;
+-
+- //Handling negative values first
+- size_t max_count = get_max_count(log_divisor, last - first);
+- RandomAccessIter lastPos = first;
+- for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) {
+- size_t count = bin_cache[ii] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[ii]);
+- //sort negative values using reversed-bin spread_sort
+- else
+- negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift, comp);
+- }
+-
+- for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- if(count < 2)
+- continue;
+- if(count < max_count)
+- std::sort(lastPos, bin_cache[u]);
+- //sort positive values using normal spread_sort
+- else
+- spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift, comp);
+- }
+- }
+-
+- template <class RandomAccessIter, class cast_type, class data_type>
+- inline void
+- float_Sort(RandomAccessIter first, RandomAccessIter last, cast_type, data_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- float_sort_rec<RandomAccessIter, cast_type, data_type>(first, last, bin_cache, 0, bin_sizes);
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift>
+- inline void
+- float_Sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(first, last, bin_cache, 0, bin_sizes, shift);
+- }
+-
+- template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare>
+- inline void
+- float_Sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift, compare comp)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(first, last, bin_cache, 0, bin_sizes, shift, comp);
+- }
+- }
+-
+- //float_sort with casting
+- //The cast_type must be equal in size to the data type, and must be a signed integer
+- template <class RandomAccessIter, class cast_type>
+- inline void float_sort_cast(RandomAccessIter first, RandomAccessIter last, cast_type cVal)
+- {
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last);
+- else
+- detail::float_Sort(first, last, cVal, *first);
+- }
+-
+- //float_sort with casting to an int
+- //Only use this with IEEE floating-point numbers
+- template <class RandomAccessIter>
+- inline void float_sort_cast_to_int(RandomAccessIter first, RandomAccessIter last)
+- {
+- int cVal = 0;
+- float_sort_cast(first, last, cVal);
+- }
+-
+- //float_sort with functors
+- template <class RandomAccessIter, class right_shift>
+- inline void float_sort(RandomAccessIter first, RandomAccessIter last, right_shift shift)
+- {
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last);
+- else
+- detail::float_Sort(first, last, shift(*first, 0), *first, shift);
+- }
+-
+- template <class RandomAccessIter, class right_shift, class compare>
+- inline void float_sort(RandomAccessIter first, RandomAccessIter last, right_shift shift, compare comp)
+- {
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last, comp);
+- else
+- detail::float_Sort(first, last, shift(*first, 0), *first, shift, comp);
+- }
+-
+- //------------------------------------------------- string_sort source ---------------------------------------------
+- namespace detail {
+- //Offsetting on identical characters. This function works a character at a time for optimal worst-case performance.
+- template<class RandomAccessIter>
+- inline void
+- update_offset(RandomAccessIter first, RandomAccessIter finish, unsigned &char_offset)
+- {
+- unsigned nextOffset = char_offset;
+- bool done = false;
+- while(!done) {
+- RandomAccessIter curr = first;
+- do {
+- //ignore empties, but if the nextOffset would exceed the length or not match, exit; we've found the last matching character
+- if((*curr).size() > char_offset && ((*curr).size() <= (nextOffset + 1) || (*curr)[nextOffset] != (*first)[nextOffset])) {
+- done = true;
+- break;
+- }
+- } while(++curr != finish);
+- if(!done)
+- ++nextOffset;
+- }
+- char_offset = nextOffset;
+- }
+-
+- //Offsetting on identical characters. This function works a character at a time for optimal worst-case performance.
+- template<class RandomAccessIter, class get_char, class get_length>
+- inline void
+- update_offset(RandomAccessIter first, RandomAccessIter finish, unsigned &char_offset, get_char getchar, get_length length)
+- {
+- unsigned nextOffset = char_offset;
+- bool done = false;
+- while(!done) {
+- RandomAccessIter curr = first;
+- do {
+- //ignore empties, but if the nextOffset would exceed the length or not match, exit; we've found the last matching character
+- if(length(*curr) > char_offset && (length(*curr) <= (nextOffset + 1) || getchar((*curr), nextOffset) != getchar((*first), nextOffset))) {
+- done = true;
+- break;
+- }
+- } while(++curr != finish);
+- if(!done)
+- ++nextOffset;
+- }
+- char_offset = nextOffset;
+- }
+-
+- //A comparison functor for strings that assumes they are identical up to char_offset
+- template<class data_type, class unsignedchar_type>
+- struct offset_lessthan {
+- offset_lessthan(unsigned char_offset) : fchar_offset(char_offset){}
+- inline bool operator()(const data_type &x, const data_type &y) const
+- {
+- unsigned minSize = std::min(x.size(), y.size());
+- for(unsigned u = fchar_offset; u < minSize; ++u) {
+- if(static_cast<unsignedchar_type>(x[u]) < static_cast<unsignedchar_type>(y[u]))
+- return true;
+- else if(static_cast<unsignedchar_type>(y[u]) < static_cast<unsignedchar_type>(x[u]))
+- return false;
+- }
+- return x.size() < y.size();
+- }
+- unsigned fchar_offset;
+- };
+-
+- //A comparison functor for strings that assumes they are identical up to char_offset
+- template<class data_type, class unsignedchar_type>
+- struct offset_greaterthan {
+- offset_greaterthan(unsigned char_offset) : fchar_offset(char_offset){}
+- inline bool operator()(const data_type &x, const data_type &y) const
+- {
+- unsigned minSize = std::min(x.size(), y.size());
+- for(unsigned u = fchar_offset; u < minSize; ++u) {
+- if(static_cast<unsignedchar_type>(x[u]) > static_cast<unsignedchar_type>(y[u]))
+- return true;
+- else if(static_cast<unsignedchar_type>(y[u]) > static_cast<unsignedchar_type>(x[u]))
+- return false;
+- }
+- return x.size() > y.size();
+- }
+- unsigned fchar_offset;
+- };
+-
+- //A comparison functor for strings that assumes they are identical up to char_offset
+- template<class data_type, class get_char, class get_length>
+- struct offset_char_lessthan {
+- offset_char_lessthan(unsigned char_offset) : fchar_offset(char_offset){}
+- inline bool operator()(const data_type &x, const data_type &y) const
+- {
+- unsigned minSize = std::min(length(x), length(y));
+- for(unsigned u = fchar_offset; u < minSize; ++u) {
+- if(getchar(x, u) < getchar(y, u))
+- return true;
+- else if(getchar(y, u) < getchar(x, u))
+- return false;
+- }
+- return length(x) < length(y);
+- }
+- unsigned fchar_offset;
+- get_char getchar;
+- get_length length;
+- };
+-
+- //String sorting recursive implementation
+- template <class RandomAccessIter, class data_type, class unsignedchar_type>
+- inline void
+- string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache
+- , unsigned cache_offset, std::vector<size_t> &bin_sizes)
+- {
+- //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact.
+- //Iterate to the end of the empties. If all empty, return
+- while((*first).size() <= char_offset) {
+- if(++first == last)
+- return;
+- }
+- RandomAccessIter finish = last - 1;
+- //Getting the last non-empty
+- for(;(*finish).size() <= char_offset; --finish) { }
+- ++finish;
+- //Offsetting on identical characters. This section works a character at a time for optimal worst-case performance.
+- update_offset(first, finish, char_offset);
+-
+- const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8));
+- //Equal worst-case between radix and comparison-based is when bin_count = n*log(n).
+- const unsigned max_size = bin_count;
+- const unsigned membin_count = bin_count + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count) + 1;
+-
+- //Calculating the size of each bin; this takes roughly 10% of runtime
+- for (RandomAccessIter current = first; current != last; ++current) {
+- if((*current).size() <= char_offset) {
+- bin_sizes[0]++;
+- }
+- else
+- bin_sizes[static_cast<unsignedchar_type>((*current)[char_offset]) + 1]++;
+- }
+- //Assign the bin positions
+- bin_cache[cache_offset] = first;
+- for(unsigned u = 0; u < membin_count - 1; u++)
+- bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- //handling empty bins
+- RandomAccessIter * local_bin = &(bin_cache[cache_offset]);
+- nextbinstart += bin_sizes[0];
+- RandomAccessIter * target_bin;
+- //Iterating over each element in the bin of empties
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //empties belong in this bin
+- while((*current).size() > char_offset) {
+- target_bin = bins + static_cast<unsignedchar_type>((*current)[char_offset]);
+- iter_swap(current, (*target_bin)++);
+- }
+- }
+- *local_bin = nextbinstart;
+- //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops
+- unsigned last_bin = bin_count - 1;
+- for(; last_bin && !bin_sizes[last_bin + 1]; --last_bin) { }
+- //This dominates runtime, mostly in the swap and bin lookups
+- for(unsigned u = 0; u < last_bin; ++u) {
+- local_bin = bins + u;
+- nextbinstart += bin_sizes[u + 1];
+- //Iterating over each element in this bin
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //Swapping elements in current into place until the correct element has been swapped in
+- for(target_bin = bins + static_cast<unsignedchar_type>((*current)[char_offset]); target_bin != local_bin;
+- target_bin = bins + static_cast<unsignedchar_type>((*current)[char_offset]))
+- iter_swap(current, (*target_bin)++);
+- }
+- *local_bin = nextbinstart;
+- }
+- bins[last_bin] = last;
+- //Recursing
+- RandomAccessIter lastPos = bin_cache[cache_offset];
+- //Skip this loop for empties
+- for(unsigned u = cache_offset + 1; u < cache_offset + last_bin + 2; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- //don't sort unless there are at least two items to compare
+- if(count < 2)
+- continue;
+- //using std::sort if its worst-case is better
+- if(count < max_size)
+- std::sort(lastPos, bin_cache[u], offset_lessthan<data_type, unsignedchar_type>(char_offset + 1));
+- else
+- string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(lastPos, bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes);
+- }
+- }
+-
+- //Sorts strings in reverse order, with empties at the end
+- template <class RandomAccessIter, class data_type, class unsignedchar_type>
+- inline void
+- reverse_string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache
+- , unsigned cache_offset, std::vector<size_t> &bin_sizes)
+- {
+- //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact.
+- RandomAccessIter curr = first;
+- //Iterate to the end of the empties. If all empty, return
+- while((*curr).size() <= char_offset) {
+- if(++curr == last)
+- return;
+- }
+- //Getting the last non-empty
+- while((*(--last)).size() <= char_offset) { }
+- ++last;
+- //Offsetting on identical characters. This section works a character at a time for optimal worst-case performance.
+- update_offset(curr, last, char_offset);
+- RandomAccessIter * target_bin;
+-
+- const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8));
+- //Equal worst-case between radix and comparison-based is when bin_count = n*log(n).
+- const unsigned max_size = bin_count;
+- const unsigned membin_count = bin_count + 1;
+- const unsigned max_bin = bin_count - 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count);
+- RandomAccessIter * end_bin = &(bin_cache[cache_offset + max_bin]);
+-
+- //Calculating the size of each bin; this takes roughly 10% of runtime
+- for (RandomAccessIter current = first; current != last; ++current) {
+- if((*current).size() <= char_offset) {
+- bin_sizes[bin_count]++;
+- }
+- else
+- bin_sizes[max_bin - static_cast<unsignedchar_type>((*current)[char_offset])]++;
+- }
+- //Assign the bin positions
+- bin_cache[cache_offset] = first;
+- for(unsigned u = 0; u < membin_count - 1; u++)
+- bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = last;
+- //handling empty bins
+- RandomAccessIter * local_bin = &(bin_cache[cache_offset + bin_count]);
+- RandomAccessIter lastFull = *local_bin;
+- //Iterating over each element in the bin of empties
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //empties belong in this bin
+- while((*current).size() > char_offset) {
+- target_bin = end_bin - static_cast<unsignedchar_type>((*current)[char_offset]);
+- iter_swap(current, (*target_bin)++);
+- }
+- }
+- *local_bin = nextbinstart;
+- nextbinstart = first;
+- //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops
+- unsigned last_bin = max_bin;
+- for(; last_bin && !bin_sizes[last_bin]; --last_bin) { }
+- //This dominates runtime, mostly in the swap and bin lookups
+- for(unsigned u = 0; u < last_bin; ++u) {
+- local_bin = bins + u;
+- nextbinstart += bin_sizes[u];
+- //Iterating over each element in this bin
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //Swapping elements in current into place until the correct element has been swapped in
+- for(target_bin = end_bin - static_cast<unsignedchar_type>((*current)[char_offset]); target_bin != local_bin;
+- target_bin = end_bin - static_cast<unsignedchar_type>((*current)[char_offset]))
+- iter_swap(current, (*target_bin)++);
+- }
+- *local_bin = nextbinstart;
+- }
+- bins[last_bin] = lastFull;
+- //Recursing
+- RandomAccessIter lastPos = first;
+- //Skip this loop for empties
+- for(unsigned u = cache_offset; u <= cache_offset + last_bin; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- //don't sort unless there are at least two items to compare
+- if(count < 2)
+- continue;
+- //using std::sort if its worst-case is better
+- if(count < max_size)
+- std::sort(lastPos, bin_cache[u], offset_greaterthan<data_type, unsignedchar_type>(char_offset + 1));
+- else
+- reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(lastPos, bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes);
+- }
+- }
+-
+- //String sorting recursive implementation
+- template <class RandomAccessIter, class data_type, class unsignedchar_type, class get_char, class get_length>
+- inline void
+- string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache
+- , unsigned cache_offset, std::vector<size_t> &bin_sizes, get_char getchar, get_length length)
+- {
+- //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact.
+- //Iterate to the end of the empties. If all empty, return
+- while(length(*first) <= char_offset) {
+- if(++first == last)
+- return;
+- }
+- RandomAccessIter finish = last - 1;
+- //Getting the last non-empty
+- for(;length(*finish) <= char_offset; --finish) { }
+- ++finish;
+- update_offset(first, finish, char_offset, getchar, length);
+-
+- const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8));
+- //Equal worst-case between radix and comparison-based is when bin_count = n*log(n).
+- const unsigned max_size = bin_count;
+- const unsigned membin_count = bin_count + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count) + 1;
+-
+- //Calculating the size of each bin; this takes roughly 10% of runtime
+- for (RandomAccessIter current = first; current != last; ++current) {
+- if(length(*current) <= char_offset) {
+- bin_sizes[0]++;
+- }
+- else
+- bin_sizes[getchar((*current), char_offset) + 1]++;
+- }
+- //Assign the bin positions
+- bin_cache[cache_offset] = first;
+- for(unsigned u = 0; u < membin_count - 1; u++)
+- bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- //handling empty bins
+- RandomAccessIter * local_bin = &(bin_cache[cache_offset]);
+- nextbinstart += bin_sizes[0];
+- RandomAccessIter * target_bin;
+- //Iterating over each element in the bin of empties
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //empties belong in this bin
+- while(length(*current) > char_offset) {
+- target_bin = bins + getchar((*current), char_offset);
+- iter_swap(current, (*target_bin)++);
+- }
+- }
+- *local_bin = nextbinstart;
+- //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops
+- unsigned last_bin = bin_count - 1;
+- for(; last_bin && !bin_sizes[last_bin + 1]; --last_bin) { }
+- //This dominates runtime, mostly in the swap and bin lookups
+- for(unsigned ii = 0; ii < last_bin; ++ii) {
+- local_bin = bins + ii;
+- nextbinstart += bin_sizes[ii + 1];
+- //Iterating over each element in this bin
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //Swapping elements in current into place until the correct element has been swapped in
+- for(target_bin = bins + getchar((*current), char_offset); target_bin != local_bin;
+- target_bin = bins + getchar((*current), char_offset))
+- iter_swap(current, (*target_bin)++);
+- }
+- *local_bin = nextbinstart;
+- }
+- bins[last_bin] = last;
+-
+- //Recursing
+- RandomAccessIter lastPos = bin_cache[cache_offset];
+- //Skip this loop for empties
+- for(unsigned u = cache_offset + 1; u < cache_offset + last_bin + 2; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- //don't sort unless there are at least two items to compare
+- if(count < 2)
+- continue;
+- //using std::sort if its worst-case is better
+- if(count < max_size)
+- std::sort(lastPos, bin_cache[u], offset_char_lessthan<data_type, get_char, get_length>(char_offset + 1));
+- else
+- string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length>(lastPos, bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes, getchar, length);
+- }
+- }
+-
+- //String sorting recursive implementation
+- template <class RandomAccessIter, class data_type, class unsignedchar_type, class get_char, class get_length, class compare>
+- inline void
+- string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache
+- , unsigned cache_offset, std::vector<size_t> &bin_sizes, get_char getchar, get_length length, compare comp)
+- {
+- //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact.
+- //Iterate to the end of the empties. If all empty, return
+- while(length(*first) <= char_offset) {
+- if(++first == last)
+- return;
+- }
+- RandomAccessIter finish = last - 1;
+- //Getting the last non-empty
+- for(;length(*finish) <= char_offset; --finish) { }
+- ++finish;
+- update_offset(first, finish, char_offset, getchar, length);
+-
+- const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8));
+- //Equal worst-case between radix and comparison-based is when bin_count = n*log(n).
+- const unsigned max_size = bin_count;
+- const unsigned membin_count = bin_count + 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count) + 1;
+-
+- //Calculating the size of each bin; this takes roughly 10% of runtime
+- for (RandomAccessIter current = first; current != last; ++current) {
+- if(length(*current) <= char_offset) {
+- bin_sizes[0]++;
+- }
+- else
+- bin_sizes[getchar((*current), char_offset) + 1]++;
+- }
+- //Assign the bin positions
+- bin_cache[cache_offset] = first;
+- for(unsigned u = 0; u < membin_count - 1; u++)
+- bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = first;
+- //handling empty bins
+- RandomAccessIter * local_bin = &(bin_cache[cache_offset]);
+- nextbinstart += bin_sizes[0];
+- RandomAccessIter * target_bin;
+- //Iterating over each element in the bin of empties
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //empties belong in this bin
+- while(length(*current) > char_offset) {
+- target_bin = bins + getchar((*current), char_offset);
+- iter_swap(current, (*target_bin)++);
+- }
+- }
+- *local_bin = nextbinstart;
+- //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops
+- unsigned last_bin = bin_count - 1;
+- for(; last_bin && !bin_sizes[last_bin + 1]; --last_bin) { }
+- //This dominates runtime, mostly in the swap and bin lookups
+- for(unsigned u = 0; u < last_bin; ++u) {
+- local_bin = bins + u;
+- nextbinstart += bin_sizes[u + 1];
+- //Iterating over each element in this bin
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //Swapping elements in current into place until the correct element has been swapped in
+- for(target_bin = bins + getchar((*current), char_offset); target_bin != local_bin;
+- target_bin = bins + getchar((*current), char_offset))
+- iter_swap(current, (*target_bin)++);
+- }
+- *local_bin = nextbinstart;
+- }
+- bins[last_bin] = last;
+-
+- //Recursing
+- RandomAccessIter lastPos = bin_cache[cache_offset];
+- //Skip this loop for empties
+- for(unsigned u = cache_offset + 1; u < cache_offset + last_bin + 2; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- //don't sort unless there are at least two items to compare
+- if(count < 2)
+- continue;
+- //using std::sort if its worst-case is better
+- if(count < max_size)
+- std::sort(lastPos, bin_cache[u], comp);
+- else
+- string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(lastPos
+- , bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes, getchar, length, comp);
+- }
+- }
+-
+- //Sorts strings in reverse order, with empties at the end
+- template <class RandomAccessIter, class data_type, class unsignedchar_type, class get_char, class get_length, class compare>
+- inline void
+- reverse_string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache
+- , unsigned cache_offset, std::vector<size_t> &bin_sizes, get_char getchar, get_length length, compare comp)
+- {
+- //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact.
+- RandomAccessIter curr = first;
+- //Iterate to the end of the empties. If all empty, return
+- while(length(*curr) <= char_offset) {
+- if(++curr == last)
+- return;
+- }
+- //Getting the last non-empty
+- while(length(*(--last)) <= char_offset) { }
+- ++last;
+- //Offsetting on identical characters. This section works a character at a time for optimal worst-case performance.
+- update_offset(first, last, char_offset, getchar, length);
+-
+- const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8));
+- //Equal worst-case between radix and comparison-based is when bin_count = n*log(n).
+- const unsigned max_size = bin_count;
+- const unsigned membin_count = bin_count + 1;
+- const unsigned max_bin = bin_count - 1;
+- unsigned cache_end;
+- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count);
+- RandomAccessIter *end_bin = &(bin_cache[cache_offset + max_bin]);
+-
+- //Calculating the size of each bin; this takes roughly 10% of runtime
+- for (RandomAccessIter current = first; current != last; ++current) {
+- if(length(*current) <= char_offset) {
+- bin_sizes[bin_count]++;
+- }
+- else
+- bin_sizes[max_bin - getchar((*current), char_offset)]++;
+- }
+- //Assign the bin positions
+- bin_cache[cache_offset] = first;
+- for(unsigned u = 0; u < membin_count - 1; u++)
+- bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u];
+-
+- //Swap into place
+- RandomAccessIter nextbinstart = last;
+- //handling empty bins
+- RandomAccessIter * local_bin = &(bin_cache[cache_offset + bin_count]);
+- RandomAccessIter lastFull = *local_bin;
+- RandomAccessIter * target_bin;
+- //Iterating over each element in the bin of empties
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //empties belong in this bin
+- while(length(*current) > char_offset) {
+- target_bin = end_bin - getchar((*current), char_offset);
+- iter_swap(current, (*target_bin)++);
+- }
+- }
+- *local_bin = nextbinstart;
+- nextbinstart = first;
+- //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops
+- unsigned last_bin = max_bin;
+- for(; last_bin && !bin_sizes[last_bin]; --last_bin) { }
+- //This dominates runtime, mostly in the swap and bin lookups
+- for(unsigned u = 0; u < last_bin; ++u) {
+- local_bin = bins + u;
+- nextbinstart += bin_sizes[u];
+- //Iterating over each element in this bin
+- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) {
+- //Swapping elements in current into place until the correct element has been swapped in
+- for(target_bin = end_bin - getchar((*current), char_offset); target_bin != local_bin;
+- target_bin = end_bin - getchar((*current), char_offset))
+- iter_swap(current, (*target_bin)++);
+- }
+- *local_bin = nextbinstart;
+- }
+- bins[last_bin] = lastFull;
+- //Recursing
+- RandomAccessIter lastPos = first;
+- //Skip this loop for empties
+- for(unsigned u = cache_offset; u <= cache_offset + last_bin; lastPos = bin_cache[u], ++u) {
+- size_t count = bin_cache[u] - lastPos;
+- //don't sort unless there are at least two items to compare
+- if(count < 2)
+- continue;
+- //using std::sort if its worst-case is better
+- if(count < max_size)
+- std::sort(lastPos, bin_cache[u], comp);
+- else
+- reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(lastPos
+- , bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes, getchar, length, comp);
+- }
+- }
+-
+- //Holds the bin vector and makes the initial recursive call
+- template <class RandomAccessIter, class data_type, class unsignedchar_type>
+- inline void
+- string_sort(RandomAccessIter first, RandomAccessIter last, data_type, unsignedchar_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(first, last, 0, bin_cache, 0, bin_sizes);
+- }
+-
+- //Holds the bin vector and makes the initial recursive call
+- template <class RandomAccessIter, class data_type, class unsignedchar_type>
+- inline void
+- reverse_string_sort(RandomAccessIter first, RandomAccessIter last, data_type, unsignedchar_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(first, last, 0, bin_cache, 0, bin_sizes);
+- }
+-
+- //Holds the bin vector and makes the initial recursive call
+- template <class RandomAccessIter, class get_char, class get_length, class data_type, class unsignedchar_type>
+- inline void
+- string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, data_type, unsignedchar_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length>(first, last, 0, bin_cache, 0, bin_sizes, getchar, length);
+- }
+-
+- //Holds the bin vector and makes the initial recursive call
+- template <class RandomAccessIter, class get_char, class get_length, class compare, class data_type, class unsignedchar_type>
+- inline void
+- string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp, data_type, unsignedchar_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(first, last, 0, bin_cache, 0, bin_sizes, getchar, length, comp);
+- }
+-
+- //Holds the bin vector and makes the initial recursive call
+- template <class RandomAccessIter, class get_char, class get_length, class compare, class data_type, class unsignedchar_type>
+- inline void
+- reverse_string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp, data_type, unsignedchar_type)
+- {
+- std::vector<size_t> bin_sizes;
+- std::vector<RandomAccessIter> bin_cache;
+- reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(first, last, 0, bin_cache, 0, bin_sizes, getchar, length, comp);
+- }
+- }
+-
+- //Allows character-type overloads
+- template <class RandomAccessIter, class unsignedchar_type>
+- inline void string_sort(RandomAccessIter first, RandomAccessIter last, unsignedchar_type unused)
+- {
+- //Don't sort if it's too small to optimize
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last);
+- else
+- detail::string_sort(first, last, *first, unused);
+- }
+-
+- //Top-level sorting call; wraps using default of unsigned char
+- template <class RandomAccessIter>
+- inline void string_sort(RandomAccessIter first, RandomAccessIter last)
+- {
+- unsigned char unused = '\0';
+- string_sort(first, last, unused);
+- }
+-
+- //Allows character-type overloads
+- template <class RandomAccessIter, class compare, class unsignedchar_type>
+- inline void reverse_string_sort(RandomAccessIter first, RandomAccessIter last, compare comp, unsignedchar_type unused)
+- {
+- //Don't sort if it's too small to optimize
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last, comp);
+- else
+- detail::reverse_string_sort(first, last, *first, unused);
+- }
+-
+- //Top-level sorting call; wraps using default of unsigned char
+- template <class RandomAccessIter, class compare>
+- inline void reverse_string_sort(RandomAccessIter first, RandomAccessIter last, compare comp)
+- {
+- unsigned char unused = '\0';
+- reverse_string_sort(first, last, comp, unused);
+- }
+-
+- template <class RandomAccessIter, class get_char, class get_length>
+- inline void string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length)
+- {
+- //Don't sort if it's too small to optimize
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last);
+- else {
+- //skipping past empties at the beginning, which allows us to get the character type
+- //.empty() is not used so as not to require a user declaration of it
+- while(!length(*first)) {
+- if(++first == last)
+- return;
+- }
+- detail::string_sort(first, last, getchar, length, *first, getchar((*first), 0));
+- }
+- }
+-
+- template <class RandomAccessIter, class get_char, class get_length, class compare>
+- inline void string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp)
+- {
+- //Don't sort if it's too small to optimize
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last, comp);
+- else {
+- //skipping past empties at the beginning, which allows us to get the character type
+- //.empty() is not used so as not to require a user declaration of it
+- while(!length(*first)) {
+- if(++first == last)
+- return;
+- }
+- detail::string_sort(first, last, getchar, length, comp, *first, getchar((*first), 0));
+- }
+- }
+-
+- template <class RandomAccessIter, class get_char, class get_length, class compare>
+- inline void reverse_string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp)
+- {
+- //Don't sort if it's too small to optimize
+- if(last - first < detail::MIN_SORT_SIZE)
+- std::sort(first, last, comp);
+- else {
+- //skipping past empties at the beginning, which allows us to get the character type
+- //.empty() is not used so as not to require a user declaration of it
+- while(!length(*(--last))) {
+- //Note: if there is just one non-empty, and it's at the beginning, then it's already in sorted order
+- if(first == last)
+- return;
+- }
+- //making last just after the end of the non-empty part of the array
+- ++last;
+- detail::reverse_string_sort(first, last, getchar, length, comp, *first, getchar((*first), 0));
+- }
+- }
+-}
+-
+-#endif
++//Templated spread_sort library ++ ++// Copyright Steven J. Ross 2001 - 2009. ++// Distributed under the Boost Software License, Version 1.0. ++// (See accompanying file LICENSE_1_0.txt or copy at ++// http://www.boost.org/LICENSE_1_0.txt) ++ ++// See http://www.boost.org/ for updates, documentation, and revision history. ++ ++/* ++Some improvements suggested by: ++Phil Endecott and Frank Gennari ++Cygwin fix provided by: ++Scott McMurray ++*/ ++ ++#ifndef BOOST_SPREAD_SORT_H ++#define BOOST_SPREAD_SORT_H ++#include <algorithm> ++#include <cstring> ++#include <vector> ++#include "webrtc/system_wrappers/source/spreadsortlib/constants.hpp" ++ ++#ifdef __FreeBSD__ ++# include <osreldate.h> ++# if __FreeBSD_version < 900506 ++# define getchar boost_getchar ++# endif ++#endif ++ ++namespace boost { ++ namespace detail { ++ //This only works on unsigned data types ++ template <typename T> ++ inline unsigned ++ rough_log_2_size(const T& input) ++ { ++ unsigned result = 0; ++ //The && is necessary on some compilers to avoid infinite loops; it doesn't significantly impair performance ++ while((input >> result) && (result < (8*sizeof(T)))) ++result; ++ return result; ++ } ++ ++ //Gets the maximum size which we'll call spread_sort on to control worst-case performance ++ //Maintains both a minimum size to recurse and a check of distribution size versus count ++ //This is called for a set of bins, instead of bin-by-bin, to avoid performance overhead ++ inline size_t ++ get_max_count(unsigned log_range, size_t count) ++ { ++ unsigned divisor = rough_log_2_size(count); ++ //Making sure the divisor is positive ++ if(divisor > LOG_MEAN_BIN_SIZE) ++ divisor -= LOG_MEAN_BIN_SIZE; ++ else ++ divisor = 1; ++ unsigned relative_width = (LOG_CONST * log_range)/((divisor > MAX_SPLITS) ? MAX_SPLITS : divisor); ++ //Don't try to bitshift more than the size of an element ++ if((8*sizeof(size_t)) <= relative_width) ++ relative_width = (8*sizeof(size_t)) - 1; ++ return (size_t)1 << ((relative_width < (LOG_MEAN_BIN_SIZE + LOG_MIN_SPLIT_COUNT)) ? ++ (LOG_MEAN_BIN_SIZE + LOG_MIN_SPLIT_COUNT) : relative_width); ++ } ++ ++ //Find the minimum and maximum using < ++ template <class RandomAccessIter> ++ inline void ++ find_extremes(RandomAccessIter current, RandomAccessIter last, RandomAccessIter & max, RandomAccessIter & min) ++ { ++ min = max = current; ++ //Start from the second item, as max and min are initialized to the first ++ while(++current < last) { ++ if(*max < *current) ++ max = current; ++ else if(*current < *min) ++ min = current; ++ } ++ } ++ ++ //Uses a user-defined comparison operator to find minimum and maximum ++ template <class RandomAccessIter, class compare> ++ inline void ++ find_extremes(RandomAccessIter current, RandomAccessIter last, RandomAccessIter & max, RandomAccessIter & min, compare comp) ++ { ++ min = max = current; ++ while(++current < last) { ++ if(comp(*max, *current)) ++ max = current; ++ else if(comp(*current, *min)) ++ min = current; ++ } ++ } ++ ++ //Gets a non-negative right bit shift to operate as a logarithmic divisor ++ inline int ++ get_log_divisor(size_t count, unsigned log_range) ++ { ++ int log_divisor; ++ //If we can finish in one iteration without exceeding either (2 to the MAX_SPLITS) or n bins, do so ++ if((log_divisor = log_range - rough_log_2_size(count)) <= 0 && log_range < MAX_SPLITS) ++ log_divisor = 0; ++ else { ++ //otherwise divide the data into an optimized number of pieces ++ log_divisor += LOG_MEAN_BIN_SIZE; ++ if(log_divisor < 0) ++ log_divisor = 0; ++ //Cannot exceed MAX_SPLITS or cache misses slow down bin lookups dramatically ++ if((log_range - log_divisor) > MAX_SPLITS) ++ log_divisor = log_range - MAX_SPLITS; ++ } ++ return log_divisor; ++ } ++ ++ template <class RandomAccessIter> ++ inline RandomAccessIter * ++ size_bins(std::vector<size_t> &bin_sizes, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset, unsigned &cache_end, unsigned bin_count) ++ { ++ //Assure space for the size of each bin, followed by initializing sizes ++ if(bin_count > bin_sizes.size()) ++ bin_sizes.resize(bin_count); ++ for(size_t u = 0; u < bin_count; u++) ++ bin_sizes[u] = 0; ++ //Make sure there is space for the bins ++ cache_end = cache_offset + bin_count; ++ if(cache_end > bin_cache.size()) ++ bin_cache.resize(cache_end); ++ return &(bin_cache[cache_offset]); ++ } ++ ++ //Implementation for recursive integer sorting ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void ++ spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes) ++ { ++ //This step is roughly 10% of runtime, but it helps avoid worst-case behavior and improve behavior with real data ++ //If you know the maximum and minimum ahead of time, you can pass those values in and skip this step for the first iteration ++ RandomAccessIter max, min; ++ find_extremes(first, last, max, min); ++ //max and min will be the same (the first item) iff all values are equivalent ++ if(max == min) ++ return; ++ RandomAccessIter * target_bin; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(*max >> 0) - (*min >> 0))); ++ div_type div_min = *min >> log_divisor; ++ div_type div_max = *max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin; this takes roughly 10% of runtime ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[(*(current++) >> log_divisor) - div_min]++; ++ //Assign the bin positions ++ bins[0] = first; ++ for(unsigned u = 0; u < bin_count - 1; u++) ++ bins[u + 1] = bins[u] + bin_sizes[u]; ++ ++ //Swap into place ++ //This dominates runtime, mostly in the swap and bin lookups ++ RandomAccessIter nextbinstart = first; ++ for(unsigned u = 0; u < bin_count - 1; ++u) { ++ RandomAccessIter * local_bin = bins + u; ++ nextbinstart += bin_sizes[u]; ++ //Iterating over each element in this bin ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //Swapping elements in current into place until the correct element has been swapped in ++ for(target_bin = (bins + ((*current >> log_divisor) - div_min)); target_bin != local_bin; ++ target_bin = bins + ((*current >> log_divisor) - div_min)) { ++ //3-way swap; this is about 1% faster than a 2-way swap with integers ++ //The main advantage is less copies are involved per item put in the correct place ++ data_type tmp; ++ RandomAccessIter b = (*target_bin)++; ++ RandomAccessIter * b_bin = bins + ((*b >> log_divisor) - div_min); ++ if (b_bin != local_bin) { ++ RandomAccessIter c = (*b_bin)++; ++ tmp = *c; ++ *c = *b; ++ } ++ else ++ tmp = *b; ++ *b = *current; ++ *current = tmp; ++ } ++ } ++ *local_bin = nextbinstart; ++ } ++ bins[bin_count - 1] = last; ++ ++ //If we've bucketsorted, the array is sorted and we should skip recursion ++ if(!log_divisor) ++ return; ++ ++ //Recursing; log_divisor is the remaining range ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ //don't sort unless there are at least two items to compare ++ if(count < 2) ++ continue; ++ //using std::sort if its worst-case is better ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u]); ++ else ++ spread_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes); ++ } ++ } ++ ++ //Generic bitshift-based 3-way swapping code ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void inner_swap_loop(RandomAccessIter * bins, const RandomAccessIter & nextbinstart, unsigned ii, right_shift &shift ++ , const unsigned log_divisor, const div_type div_min) ++ { ++ RandomAccessIter * local_bin = bins + ii; ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ for(RandomAccessIter * target_bin = (bins + (shift(*current, log_divisor) - div_min)); target_bin != local_bin; ++ target_bin = bins + (shift(*current, log_divisor) - div_min)) { ++ data_type tmp; ++ RandomAccessIter b = (*target_bin)++; ++ RandomAccessIter * b_bin = bins + (shift(*b, log_divisor) - div_min); ++ //Three-way swap; if the item to be swapped doesn't belong in the current bin, swap it to where it belongs ++ if (b_bin != local_bin) { ++ RandomAccessIter c = (*b_bin)++; ++ tmp = *c; ++ *c = *b; ++ } ++ //Note: we could increment current once the swap is done in this case, but that seems to impair performance ++ else ++ tmp = *b; ++ *b = *current; ++ *current = tmp; ++ } ++ } ++ *local_bin = nextbinstart; ++ } ++ ++ //Standard swapping wrapper for ascending values ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void swap_loop(RandomAccessIter * bins, RandomAccessIter & nextbinstart, unsigned ii, right_shift &shift ++ , const std::vector<size_t> &bin_sizes, const unsigned log_divisor, const div_type div_min) ++ { ++ nextbinstart += bin_sizes[ii]; ++ inner_swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, log_divisor, div_min); ++ } ++ ++ //Functor implementation for recursive sorting ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare> ++ inline void ++ spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes, right_shift shift, compare comp) ++ { ++ RandomAccessIter max, min; ++ find_extremes(first, last, max, min, comp); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(shift(*max, 0)) - (shift(*min, 0)))); ++ div_type div_min = shift(*min, log_divisor); ++ div_type div_max = shift(*max, log_divisor); ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[shift(*(current++), log_divisor) - div_min]++; ++ bins[0] = first; ++ for(unsigned u = 0; u < bin_count - 1; u++) ++ bins[u + 1] = bins[u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ for(unsigned u = 0; u < bin_count - 1; ++u) ++ swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, u, shift, bin_sizes, log_divisor, div_min); ++ bins[bin_count - 1] = last; ++ ++ //If we've bucketsorted, the array is sorted and we should skip recursion ++ if(!log_divisor) ++ return; ++ ++ //Recursing ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u], comp); ++ else ++ spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift, compare>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift, comp); ++ } ++ } ++ ++ //Functor implementation for recursive sorting with only Shift overridden ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void ++ spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes, right_shift shift) ++ { ++ RandomAccessIter max, min; ++ find_extremes(first, last, max, min); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(shift(*max, 0)) - (shift(*min, 0)))); ++ div_type div_min = shift(*min, log_divisor); ++ div_type div_max = shift(*max, log_divisor); ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[shift(*(current++), log_divisor) - div_min]++; ++ bins[0] = first; ++ for(unsigned u = 0; u < bin_count - 1; u++) ++ bins[u + 1] = bins[u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ for(unsigned ii = 0; ii < bin_count - 1; ++ii) ++ swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min); ++ bins[bin_count - 1] = last; ++ ++ //If we've bucketsorted, the array is sorted and we should skip recursion ++ if(!log_divisor) ++ return; ++ ++ //Recursing ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u]); ++ else ++ spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift); ++ } ++ } ++ ++ //Holds the bin vector and makes the initial recursive call ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void ++ spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ spread_sort_rec<RandomAccessIter, div_type, data_type>(first, last, bin_cache, 0, bin_sizes); ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare> ++ inline void ++ spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift, compare comp) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift, compare>(first, last, bin_cache, 0, bin_sizes, shift, comp); ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void ++ spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(first, last, bin_cache, 0, bin_sizes, shift); ++ } ++ } ++ ++ //Top-level sorting call for integers ++ template <class RandomAccessIter> ++ inline void integer_sort(RandomAccessIter first, RandomAccessIter last) ++ { ++ //Don't sort if it's too small to optimize ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last); ++ else ++ detail::spread_sort(first, last, *first >> 0, *first); ++ } ++ ++ //integer_sort with functors ++ template <class RandomAccessIter, class right_shift, class compare> ++ inline void integer_sort(RandomAccessIter first, RandomAccessIter last, ++ right_shift shift, compare comp) { ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last, comp); ++ else ++ detail::spread_sort(first, last, shift(*first, 0), *first, shift, comp); ++ } ++ ++ //integer_sort with right_shift functor ++ template <class RandomAccessIter, class right_shift> ++ inline void integer_sort(RandomAccessIter first, RandomAccessIter last, ++ right_shift shift) { ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last); ++ else ++ detail::spread_sort(first, last, shift(*first, 0), *first, shift); ++ } ++ ++ //------------------------------------------------------ float_sort source -------------------------------------- ++ //Casts a RandomAccessIter to the specified data type ++ template<class cast_type, class RandomAccessIter> ++ inline cast_type ++ cast_float_iter(const RandomAccessIter & floatiter) ++ { ++ cast_type result; ++ std::memcpy(&result, &(*floatiter), sizeof(cast_type)); ++ return result; ++ } ++ ++ //Casts a data element to the specified datinner_float_a type ++ template<class data_type, class cast_type> ++ inline cast_type ++ mem_cast(const data_type & data) ++ { ++ cast_type result; ++ std::memcpy(&result, &data, sizeof(cast_type)); ++ return result; ++ } ++ ++ namespace detail { ++ template <class RandomAccessIter, class div_type, class right_shift> ++ inline void ++ find_extremes(RandomAccessIter current, RandomAccessIter last, div_type & max, div_type & min, right_shift shift) ++ { ++ min = max = shift(*current, 0); ++ while(++current < last) { ++ div_type value = shift(*current, 0); ++ if(max < value) ++ max = value; ++ else if(value < min) ++ min = value; ++ } ++ } ++ ++ //Specialized swap loops for floating-point casting ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void inner_float_swap_loop(RandomAccessIter * bins, const RandomAccessIter & nextbinstart, unsigned ii ++ , const unsigned log_divisor, const div_type div_min) ++ { ++ RandomAccessIter * local_bin = bins + ii; ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ for(RandomAccessIter * target_bin = (bins + ((cast_float_iter<div_type, RandomAccessIter>(current) >> log_divisor) - div_min)); target_bin != local_bin; ++ target_bin = bins + ((cast_float_iter<div_type, RandomAccessIter>(current) >> log_divisor) - div_min)) { ++ data_type tmp; ++ RandomAccessIter b = (*target_bin)++; ++ RandomAccessIter * b_bin = bins + ((cast_float_iter<div_type, RandomAccessIter>(b) >> log_divisor) - div_min); ++ //Three-way swap; if the item to be swapped doesn't belong in the current bin, swap it to where it belongs ++ if (b_bin != local_bin) { ++ RandomAccessIter c = (*b_bin)++; ++ tmp = *c; ++ *c = *b; ++ } ++ else ++ tmp = *b; ++ *b = *current; ++ *current = tmp; ++ } ++ } ++ *local_bin = nextbinstart; ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void float_swap_loop(RandomAccessIter * bins, RandomAccessIter & nextbinstart, unsigned ii ++ , const std::vector<size_t> &bin_sizes, const unsigned log_divisor, const div_type div_min) ++ { ++ nextbinstart += bin_sizes[ii]; ++ inner_float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, ii, log_divisor, div_min); ++ } ++ ++ template <class RandomAccessIter, class cast_type> ++ inline void ++ find_extremes(RandomAccessIter current, RandomAccessIter last, cast_type & max, cast_type & min) ++ { ++ min = max = cast_float_iter<cast_type, RandomAccessIter>(current); ++ while(++current < last) { ++ cast_type value = cast_float_iter<cast_type, RandomAccessIter>(current); ++ if(max < value) ++ max = value; ++ else if(value < min) ++ min = value; ++ } ++ } ++ ++ //Special-case sorting of positive floats with casting instead of a right_shift ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void ++ positive_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[(cast_float_iter<div_type, RandomAccessIter>(current++) >> log_divisor) - div_min]++; ++ bins[0] = first; ++ for(unsigned u = 0; u < bin_count - 1; u++) ++ bins[u + 1] = bins[u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ for(unsigned u = 0; u < bin_count - 1; ++u) ++ float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, u, bin_sizes, log_divisor, div_min); ++ bins[bin_count - 1] = last; ++ ++ //Return if we've completed bucketsorting ++ if(!log_divisor) ++ return; ++ ++ //Recursing ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u]); ++ else ++ positive_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes); ++ } ++ } ++ ++ //Sorting negative_ float_s ++ //Note that bins are iterated in reverse order because max_neg_float = min_neg_int ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void ++ negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[(cast_float_iter<div_type, RandomAccessIter>(current++) >> log_divisor) - div_min]++; ++ bins[bin_count - 1] = first; ++ for(int ii = bin_count - 2; ii >= 0; --ii) ++ bins[ii] = bins[ii + 1] + bin_sizes[ii + 1]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ //The last bin will always have the correct elements in it ++ for(int ii = bin_count - 1; ii > 0; --ii) ++ float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, ii, bin_sizes, log_divisor, div_min); ++ //Since we don't process the last bin, we need to update its end position ++ bin_cache[cache_offset] = last; ++ ++ //Return if we've completed bucketsorting ++ if(!log_divisor) ++ return; ++ ++ //Recursing ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) { ++ size_t count = bin_cache[ii] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[ii]); ++ else ++ negative_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes); ++ } ++ } ++ ++ //Sorting negative_ float_s ++ //Note that bins are iterated in reverse order because max_neg_float = min_neg_int ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void ++ negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes, right_shift shift) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min, shift); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[shift(*(current++), log_divisor) - div_min]++; ++ bins[bin_count - 1] = first; ++ for(int ii = bin_count - 2; ii >= 0; --ii) ++ bins[ii] = bins[ii + 1] + bin_sizes[ii + 1]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ //The last bin will always have the correct elements in it ++ for(int ii = bin_count - 1; ii > 0; --ii) ++ swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min); ++ //Since we don't process the last bin, we need to update its end position ++ bin_cache[cache_offset] = last; ++ ++ //Return if we've completed bucketsorting ++ if(!log_divisor) ++ return; ++ ++ //Recursing ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) { ++ size_t count = bin_cache[ii] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[ii]); ++ else ++ negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift); ++ } ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare> ++ inline void ++ negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes, right_shift shift, compare comp) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min, shift); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[shift(*(current++), log_divisor) - div_min]++; ++ bins[bin_count - 1] = first; ++ for(int ii = bin_count - 2; ii >= 0; --ii) ++ bins[ii] = bins[ii + 1] + bin_sizes[ii + 1]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ //The last bin will always have the correct elements in it ++ for(int ii = bin_count - 1; ii > 0; --ii) ++ swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min); ++ //Since we don't process the last bin, we need to update its end position ++ bin_cache[cache_offset] = last; ++ ++ //Return if we've completed bucketsorting ++ if(!log_divisor) ++ return; ++ ++ //Recursing ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) { ++ size_t count = bin_cache[ii] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[ii], comp); ++ else ++ negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift, compare>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift, comp); ++ } ++ } ++ ++ //Casting special-case for floating-point sorting ++ template <class RandomAccessIter, class div_type, class data_type> ++ inline void ++ float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[(cast_float_iter<div_type, RandomAccessIter>(current++) >> log_divisor) - div_min]++; ++ //The index of the first positive bin ++ div_type first_positive = (div_min < 0) ? -div_min : 0; ++ //Resetting if all bins are negative ++ if(cache_offset + first_positive > cache_end) ++ first_positive = cache_end - cache_offset; ++ //Reversing the order of the negative bins ++ //Note that because of the negative/positive ordering direction flip ++ //We can not depend upon bin order and positions matching up ++ //so bin_sizes must be reused to contain the end of the bin ++ if(first_positive > 0) { ++ bins[first_positive - 1] = first; ++ for(int ii = first_positive - 2; ii >= 0; --ii) { ++ bins[ii] = first + bin_sizes[ii + 1]; ++ bin_sizes[ii] += bin_sizes[ii + 1]; ++ } ++ //Handling positives following negatives ++ if((unsigned)first_positive < bin_count) { ++ bins[first_positive] = first + bin_sizes[0]; ++ bin_sizes[first_positive] += bin_sizes[0]; ++ } ++ } ++ else ++ bins[0] = first; ++ for(unsigned u = first_positive; u < bin_count - 1; u++) { ++ bins[u + 1] = first + bin_sizes[u]; ++ bin_sizes[u + 1] += bin_sizes[u]; ++ } ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ for(unsigned u = 0; u < bin_count; ++u) { ++ nextbinstart = first + bin_sizes[u]; ++ inner_float_swap_loop<RandomAccessIter, div_type, data_type>(bins, nextbinstart, u, log_divisor, div_min); ++ } ++ ++ if(!log_divisor) ++ return; ++ ++ //Handling negative values first ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) { ++ size_t count = bin_cache[ii] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[ii]); ++ //sort negative values using reversed-bin spread_sort ++ else ++ negative_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes); ++ } ++ ++ for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u]); ++ //sort positive values using normal spread_sort ++ else ++ positive_float_sort_rec<RandomAccessIter, div_type, data_type>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes); ++ } ++ } ++ ++ //Functor implementation for recursive sorting ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void ++ float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes, right_shift shift) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min, shift); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[shift(*(current++), log_divisor) - div_min]++; ++ //The index of the first positive bin ++ div_type first_positive = (div_min < 0) ? -div_min : 0; ++ //Resetting if all bins are negative ++ if(cache_offset + first_positive > cache_end) ++ first_positive = cache_end - cache_offset; ++ //Reversing the order of the negative bins ++ //Note that because of the negative/positive ordering direction flip ++ //We can not depend upon bin order and positions matching up ++ //so bin_sizes must be reused to contain the end of the bin ++ if(first_positive > 0) { ++ bins[first_positive - 1] = first; ++ for(int ii = first_positive - 2; ii >= 0; --ii) { ++ bins[ii] = first + bin_sizes[ii + 1]; ++ bin_sizes[ii] += bin_sizes[ii + 1]; ++ } ++ //Handling positives following negatives ++ if((unsigned)first_positive < bin_count) { ++ bins[first_positive] = first + bin_sizes[0]; ++ bin_sizes[first_positive] += bin_sizes[0]; ++ } ++ } ++ else ++ bins[0] = first; ++ for(unsigned u = first_positive; u < bin_count - 1; u++) { ++ bins[u + 1] = first + bin_sizes[u]; ++ bin_sizes[u + 1] += bin_sizes[u]; ++ } ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ for(unsigned u = 0; u < bin_count; ++u) { ++ nextbinstart = first + bin_sizes[u]; ++ inner_swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, u, shift, log_divisor, div_min); ++ } ++ ++ //Return if we've completed bucketsorting ++ if(!log_divisor) ++ return; ++ ++ //Handling negative values first ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) { ++ size_t count = bin_cache[ii] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[ii]); ++ //sort negative values using reversed-bin spread_sort ++ else ++ negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift); ++ } ++ ++ for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u]); ++ //sort positive values using normal spread_sort ++ else ++ spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift); ++ } ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare> ++ inline void ++ float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector<RandomAccessIter> &bin_cache, unsigned cache_offset ++ , std::vector<size_t> &bin_sizes, right_shift shift, compare comp) ++ { ++ div_type max, min; ++ find_extremes(first, last, max, min, shift); ++ if(max == min) ++ return; ++ unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); ++ div_type div_min = min >> log_divisor; ++ div_type div_max = max >> log_divisor; ++ unsigned bin_count = div_max - div_min + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); ++ ++ //Calculating the size of each bin ++ for (RandomAccessIter current = first; current != last;) ++ bin_sizes[shift(*(current++), log_divisor) - div_min]++; ++ //The index of the first positive bin ++ div_type first_positive = (div_min < 0) ? -div_min : 0; ++ //Resetting if all bins are negative ++ if(cache_offset + first_positive > cache_end) ++ first_positive = cache_end - cache_offset; ++ //Reversing the order of the negative bins ++ //Note that because of the negative/positive ordering direction flip ++ //We can not depend upon bin order and positions matching up ++ //so bin_sizes must be reused to contain the end of the bin ++ if(first_positive > 0) { ++ bins[first_positive - 1] = first; ++ for(int ii = first_positive - 2; ii >= 0; --ii) { ++ bins[ii] = first + bin_sizes[ii + 1]; ++ bin_sizes[ii] += bin_sizes[ii + 1]; ++ } ++ //Handling positives following negatives ++ if((unsigned)first_positive < bin_count) { ++ bins[first_positive] = first + bin_sizes[0]; ++ bin_sizes[first_positive] += bin_sizes[0]; ++ } ++ } ++ else ++ bins[0] = first; ++ for(unsigned u = first_positive; u < bin_count - 1; u++) { ++ bins[u + 1] = first + bin_sizes[u]; ++ bin_sizes[u + 1] += bin_sizes[u]; ++ } ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ for(unsigned u = 0; u < bin_count; ++u) { ++ nextbinstart = first + bin_sizes[u]; ++ inner_swap_loop<RandomAccessIter, div_type, data_type, right_shift>(bins, nextbinstart, u, shift, log_divisor, div_min); ++ } ++ ++ //Return if we've completed bucketsorting ++ if(!log_divisor) ++ return; ++ ++ //Handling negative values first ++ size_t max_count = get_max_count(log_divisor, last - first); ++ RandomAccessIter lastPos = first; ++ for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) { ++ size_t count = bin_cache[ii] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[ii]); ++ //sort negative values using reversed-bin spread_sort ++ else ++ negative_float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift, comp); ++ } ++ ++ for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ if(count < 2) ++ continue; ++ if(count < max_count) ++ std::sort(lastPos, bin_cache[u]); ++ //sort positive values using normal spread_sort ++ else ++ spread_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift, comp); ++ } ++ } ++ ++ template <class RandomAccessIter, class cast_type, class data_type> ++ inline void ++ float_Sort(RandomAccessIter first, RandomAccessIter last, cast_type, data_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ float_sort_rec<RandomAccessIter, cast_type, data_type>(first, last, bin_cache, 0, bin_sizes); ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift> ++ inline void ++ float_Sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(first, last, bin_cache, 0, bin_sizes, shift); ++ } ++ ++ template <class RandomAccessIter, class div_type, class data_type, class right_shift, class compare> ++ inline void ++ float_Sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift, compare comp) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ float_sort_rec<RandomAccessIter, div_type, data_type, right_shift>(first, last, bin_cache, 0, bin_sizes, shift, comp); ++ } ++ } ++ ++ //float_sort with casting ++ //The cast_type must be equal in size to the data type, and must be a signed integer ++ template <class RandomAccessIter, class cast_type> ++ inline void float_sort_cast(RandomAccessIter first, RandomAccessIter last, cast_type cVal) ++ { ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last); ++ else ++ detail::float_Sort(first, last, cVal, *first); ++ } ++ ++ //float_sort with casting to an int ++ //Only use this with IEEE floating-point numbers ++ template <class RandomAccessIter> ++ inline void float_sort_cast_to_int(RandomAccessIter first, RandomAccessIter last) ++ { ++ int cVal = 0; ++ float_sort_cast(first, last, cVal); ++ } ++ ++ //float_sort with functors ++ template <class RandomAccessIter, class right_shift> ++ inline void float_sort(RandomAccessIter first, RandomAccessIter last, right_shift shift) ++ { ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last); ++ else ++ detail::float_Sort(first, last, shift(*first, 0), *first, shift); ++ } ++ ++ template <class RandomAccessIter, class right_shift, class compare> ++ inline void float_sort(RandomAccessIter first, RandomAccessIter last, right_shift shift, compare comp) ++ { ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last, comp); ++ else ++ detail::float_Sort(first, last, shift(*first, 0), *first, shift, comp); ++ } ++ ++ //------------------------------------------------- string_sort source --------------------------------------------- ++ namespace detail { ++ //Offsetting on identical characters. This function works a character at a time for optimal worst-case performance. ++ template<class RandomAccessIter> ++ inline void ++ update_offset(RandomAccessIter first, RandomAccessIter finish, unsigned &char_offset) ++ { ++ unsigned nextOffset = char_offset; ++ bool done = false; ++ while(!done) { ++ RandomAccessIter curr = first; ++ do { ++ //ignore empties, but if the nextOffset would exceed the length or not match, exit; we've found the last matching character ++ if((*curr).size() > char_offset && ((*curr).size() <= (nextOffset + 1) || (*curr)[nextOffset] != (*first)[nextOffset])) { ++ done = true; ++ break; ++ } ++ } while(++curr != finish); ++ if(!done) ++ ++nextOffset; ++ } ++ char_offset = nextOffset; ++ } ++ ++ //Offsetting on identical characters. This function works a character at a time for optimal worst-case performance. ++ template<class RandomAccessIter, class get_char, class get_length> ++ inline void ++ update_offset(RandomAccessIter first, RandomAccessIter finish, unsigned &char_offset, get_char getchar, get_length length) ++ { ++ unsigned nextOffset = char_offset; ++ bool done = false; ++ while(!done) { ++ RandomAccessIter curr = first; ++ do { ++ //ignore empties, but if the nextOffset would exceed the length or not match, exit; we've found the last matching character ++ if(length(*curr) > char_offset && (length(*curr) <= (nextOffset + 1) || getchar((*curr), nextOffset) != getchar((*first), nextOffset))) { ++ done = true; ++ break; ++ } ++ } while(++curr != finish); ++ if(!done) ++ ++nextOffset; ++ } ++ char_offset = nextOffset; ++ } ++ ++ //A comparison functor for strings that assumes they are identical up to char_offset ++ template<class data_type, class unsignedchar_type> ++ struct offset_lessthan { ++ offset_lessthan(unsigned char_offset) : fchar_offset(char_offset){} ++ inline bool operator()(const data_type &x, const data_type &y) const ++ { ++ unsigned minSize = std::min(x.size(), y.size()); ++ for(unsigned u = fchar_offset; u < minSize; ++u) { ++ if(static_cast<unsignedchar_type>(x[u]) < static_cast<unsignedchar_type>(y[u])) ++ return true; ++ else if(static_cast<unsignedchar_type>(y[u]) < static_cast<unsignedchar_type>(x[u])) ++ return false; ++ } ++ return x.size() < y.size(); ++ } ++ unsigned fchar_offset; ++ }; ++ ++ //A comparison functor for strings that assumes they are identical up to char_offset ++ template<class data_type, class unsignedchar_type> ++ struct offset_greaterthan { ++ offset_greaterthan(unsigned char_offset) : fchar_offset(char_offset){} ++ inline bool operator()(const data_type &x, const data_type &y) const ++ { ++ unsigned minSize = std::min(x.size(), y.size()); ++ for(unsigned u = fchar_offset; u < minSize; ++u) { ++ if(static_cast<unsignedchar_type>(x[u]) > static_cast<unsignedchar_type>(y[u])) ++ return true; ++ else if(static_cast<unsignedchar_type>(y[u]) > static_cast<unsignedchar_type>(x[u])) ++ return false; ++ } ++ return x.size() > y.size(); ++ } ++ unsigned fchar_offset; ++ }; ++ ++ //A comparison functor for strings that assumes they are identical up to char_offset ++ template<class data_type, class get_char, class get_length> ++ struct offset_char_lessthan { ++ offset_char_lessthan(unsigned char_offset) : fchar_offset(char_offset){} ++ inline bool operator()(const data_type &x, const data_type &y) const ++ { ++ unsigned minSize = std::min(length(x), length(y)); ++ for(unsigned u = fchar_offset; u < minSize; ++u) { ++ if(getchar(x, u) < getchar(y, u)) ++ return true; ++ else if(getchar(y, u) < getchar(x, u)) ++ return false; ++ } ++ return length(x) < length(y); ++ } ++ unsigned fchar_offset; ++ get_char getchar; ++ get_length length; ++ }; ++ ++ //String sorting recursive implementation ++ template <class RandomAccessIter, class data_type, class unsignedchar_type> ++ inline void ++ string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache ++ , unsigned cache_offset, std::vector<size_t> &bin_sizes) ++ { ++ //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact. ++ //Iterate to the end of the empties. If all empty, return ++ while((*first).size() <= char_offset) { ++ if(++first == last) ++ return; ++ } ++ RandomAccessIter finish = last - 1; ++ //Getting the last non-empty ++ for(;(*finish).size() <= char_offset; --finish) { } ++ ++finish; ++ //Offsetting on identical characters. This section works a character at a time for optimal worst-case performance. ++ update_offset(first, finish, char_offset); ++ ++ const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8)); ++ //Equal worst-case between radix and comparison-based is when bin_count = n*log(n). ++ const unsigned max_size = bin_count; ++ const unsigned membin_count = bin_count + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count) + 1; ++ ++ //Calculating the size of each bin; this takes roughly 10% of runtime ++ for (RandomAccessIter current = first; current != last; ++current) { ++ if((*current).size() <= char_offset) { ++ bin_sizes[0]++; ++ } ++ else ++ bin_sizes[static_cast<unsignedchar_type>((*current)[char_offset]) + 1]++; ++ } ++ //Assign the bin positions ++ bin_cache[cache_offset] = first; ++ for(unsigned u = 0; u < membin_count - 1; u++) ++ bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ //handling empty bins ++ RandomAccessIter * local_bin = &(bin_cache[cache_offset]); ++ nextbinstart += bin_sizes[0]; ++ RandomAccessIter * target_bin; ++ //Iterating over each element in the bin of empties ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //empties belong in this bin ++ while((*current).size() > char_offset) { ++ target_bin = bins + static_cast<unsignedchar_type>((*current)[char_offset]); ++ iter_swap(current, (*target_bin)++); ++ } ++ } ++ *local_bin = nextbinstart; ++ //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops ++ unsigned last_bin = bin_count - 1; ++ for(; last_bin && !bin_sizes[last_bin + 1]; --last_bin) { } ++ //This dominates runtime, mostly in the swap and bin lookups ++ for(unsigned u = 0; u < last_bin; ++u) { ++ local_bin = bins + u; ++ nextbinstart += bin_sizes[u + 1]; ++ //Iterating over each element in this bin ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //Swapping elements in current into place until the correct element has been swapped in ++ for(target_bin = bins + static_cast<unsignedchar_type>((*current)[char_offset]); target_bin != local_bin; ++ target_bin = bins + static_cast<unsignedchar_type>((*current)[char_offset])) ++ iter_swap(current, (*target_bin)++); ++ } ++ *local_bin = nextbinstart; ++ } ++ bins[last_bin] = last; ++ //Recursing ++ RandomAccessIter lastPos = bin_cache[cache_offset]; ++ //Skip this loop for empties ++ for(unsigned u = cache_offset + 1; u < cache_offset + last_bin + 2; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ //don't sort unless there are at least two items to compare ++ if(count < 2) ++ continue; ++ //using std::sort if its worst-case is better ++ if(count < max_size) ++ std::sort(lastPos, bin_cache[u], offset_lessthan<data_type, unsignedchar_type>(char_offset + 1)); ++ else ++ string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(lastPos, bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes); ++ } ++ } ++ ++ //Sorts strings in reverse order, with empties at the end ++ template <class RandomAccessIter, class data_type, class unsignedchar_type> ++ inline void ++ reverse_string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache ++ , unsigned cache_offset, std::vector<size_t> &bin_sizes) ++ { ++ //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact. ++ RandomAccessIter curr = first; ++ //Iterate to the end of the empties. If all empty, return ++ while((*curr).size() <= char_offset) { ++ if(++curr == last) ++ return; ++ } ++ //Getting the last non-empty ++ while((*(--last)).size() <= char_offset) { } ++ ++last; ++ //Offsetting on identical characters. This section works a character at a time for optimal worst-case performance. ++ update_offset(curr, last, char_offset); ++ RandomAccessIter * target_bin; ++ ++ const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8)); ++ //Equal worst-case between radix and comparison-based is when bin_count = n*log(n). ++ const unsigned max_size = bin_count; ++ const unsigned membin_count = bin_count + 1; ++ const unsigned max_bin = bin_count - 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count); ++ RandomAccessIter * end_bin = &(bin_cache[cache_offset + max_bin]); ++ ++ //Calculating the size of each bin; this takes roughly 10% of runtime ++ for (RandomAccessIter current = first; current != last; ++current) { ++ if((*current).size() <= char_offset) { ++ bin_sizes[bin_count]++; ++ } ++ else ++ bin_sizes[max_bin - static_cast<unsignedchar_type>((*current)[char_offset])]++; ++ } ++ //Assign the bin positions ++ bin_cache[cache_offset] = first; ++ for(unsigned u = 0; u < membin_count - 1; u++) ++ bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = last; ++ //handling empty bins ++ RandomAccessIter * local_bin = &(bin_cache[cache_offset + bin_count]); ++ RandomAccessIter lastFull = *local_bin; ++ //Iterating over each element in the bin of empties ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //empties belong in this bin ++ while((*current).size() > char_offset) { ++ target_bin = end_bin - static_cast<unsignedchar_type>((*current)[char_offset]); ++ iter_swap(current, (*target_bin)++); ++ } ++ } ++ *local_bin = nextbinstart; ++ nextbinstart = first; ++ //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops ++ unsigned last_bin = max_bin; ++ for(; last_bin && !bin_sizes[last_bin]; --last_bin) { } ++ //This dominates runtime, mostly in the swap and bin lookups ++ for(unsigned u = 0; u < last_bin; ++u) { ++ local_bin = bins + u; ++ nextbinstart += bin_sizes[u]; ++ //Iterating over each element in this bin ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //Swapping elements in current into place until the correct element has been swapped in ++ for(target_bin = end_bin - static_cast<unsignedchar_type>((*current)[char_offset]); target_bin != local_bin; ++ target_bin = end_bin - static_cast<unsignedchar_type>((*current)[char_offset])) ++ iter_swap(current, (*target_bin)++); ++ } ++ *local_bin = nextbinstart; ++ } ++ bins[last_bin] = lastFull; ++ //Recursing ++ RandomAccessIter lastPos = first; ++ //Skip this loop for empties ++ for(unsigned u = cache_offset; u <= cache_offset + last_bin; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ //don't sort unless there are at least two items to compare ++ if(count < 2) ++ continue; ++ //using std::sort if its worst-case is better ++ if(count < max_size) ++ std::sort(lastPos, bin_cache[u], offset_greaterthan<data_type, unsignedchar_type>(char_offset + 1)); ++ else ++ reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(lastPos, bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes); ++ } ++ } ++ ++ //String sorting recursive implementation ++ template <class RandomAccessIter, class data_type, class unsignedchar_type, class get_char, class get_length> ++ inline void ++ string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache ++ , unsigned cache_offset, std::vector<size_t> &bin_sizes, get_char getchar, get_length length) ++ { ++ //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact. ++ //Iterate to the end of the empties. If all empty, return ++ while(length(*first) <= char_offset) { ++ if(++first == last) ++ return; ++ } ++ RandomAccessIter finish = last - 1; ++ //Getting the last non-empty ++ for(;length(*finish) <= char_offset; --finish) { } ++ ++finish; ++ update_offset(first, finish, char_offset, getchar, length); ++ ++ const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8)); ++ //Equal worst-case between radix and comparison-based is when bin_count = n*log(n). ++ const unsigned max_size = bin_count; ++ const unsigned membin_count = bin_count + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count) + 1; ++ ++ //Calculating the size of each bin; this takes roughly 10% of runtime ++ for (RandomAccessIter current = first; current != last; ++current) { ++ if(length(*current) <= char_offset) { ++ bin_sizes[0]++; ++ } ++ else ++ bin_sizes[getchar((*current), char_offset) + 1]++; ++ } ++ //Assign the bin positions ++ bin_cache[cache_offset] = first; ++ for(unsigned u = 0; u < membin_count - 1; u++) ++ bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ //handling empty bins ++ RandomAccessIter * local_bin = &(bin_cache[cache_offset]); ++ nextbinstart += bin_sizes[0]; ++ RandomAccessIter * target_bin; ++ //Iterating over each element in the bin of empties ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //empties belong in this bin ++ while(length(*current) > char_offset) { ++ target_bin = bins + getchar((*current), char_offset); ++ iter_swap(current, (*target_bin)++); ++ } ++ } ++ *local_bin = nextbinstart; ++ //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops ++ unsigned last_bin = bin_count - 1; ++ for(; last_bin && !bin_sizes[last_bin + 1]; --last_bin) { } ++ //This dominates runtime, mostly in the swap and bin lookups ++ for(unsigned ii = 0; ii < last_bin; ++ii) { ++ local_bin = bins + ii; ++ nextbinstart += bin_sizes[ii + 1]; ++ //Iterating over each element in this bin ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //Swapping elements in current into place until the correct element has been swapped in ++ for(target_bin = bins + getchar((*current), char_offset); target_bin != local_bin; ++ target_bin = bins + getchar((*current), char_offset)) ++ iter_swap(current, (*target_bin)++); ++ } ++ *local_bin = nextbinstart; ++ } ++ bins[last_bin] = last; ++ ++ //Recursing ++ RandomAccessIter lastPos = bin_cache[cache_offset]; ++ //Skip this loop for empties ++ for(unsigned u = cache_offset + 1; u < cache_offset + last_bin + 2; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ //don't sort unless there are at least two items to compare ++ if(count < 2) ++ continue; ++ //using std::sort if its worst-case is better ++ if(count < max_size) ++ std::sort(lastPos, bin_cache[u], offset_char_lessthan<data_type, get_char, get_length>(char_offset + 1)); ++ else ++ string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length>(lastPos, bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes, getchar, length); ++ } ++ } ++ ++ //String sorting recursive implementation ++ template <class RandomAccessIter, class data_type, class unsignedchar_type, class get_char, class get_length, class compare> ++ inline void ++ string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache ++ , unsigned cache_offset, std::vector<size_t> &bin_sizes, get_char getchar, get_length length, compare comp) ++ { ++ //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact. ++ //Iterate to the end of the empties. If all empty, return ++ while(length(*first) <= char_offset) { ++ if(++first == last) ++ return; ++ } ++ RandomAccessIter finish = last - 1; ++ //Getting the last non-empty ++ for(;length(*finish) <= char_offset; --finish) { } ++ ++finish; ++ update_offset(first, finish, char_offset, getchar, length); ++ ++ const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8)); ++ //Equal worst-case between radix and comparison-based is when bin_count = n*log(n). ++ const unsigned max_size = bin_count; ++ const unsigned membin_count = bin_count + 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count) + 1; ++ ++ //Calculating the size of each bin; this takes roughly 10% of runtime ++ for (RandomAccessIter current = first; current != last; ++current) { ++ if(length(*current) <= char_offset) { ++ bin_sizes[0]++; ++ } ++ else ++ bin_sizes[getchar((*current), char_offset) + 1]++; ++ } ++ //Assign the bin positions ++ bin_cache[cache_offset] = first; ++ for(unsigned u = 0; u < membin_count - 1; u++) ++ bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = first; ++ //handling empty bins ++ RandomAccessIter * local_bin = &(bin_cache[cache_offset]); ++ nextbinstart += bin_sizes[0]; ++ RandomAccessIter * target_bin; ++ //Iterating over each element in the bin of empties ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //empties belong in this bin ++ while(length(*current) > char_offset) { ++ target_bin = bins + getchar((*current), char_offset); ++ iter_swap(current, (*target_bin)++); ++ } ++ } ++ *local_bin = nextbinstart; ++ //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops ++ unsigned last_bin = bin_count - 1; ++ for(; last_bin && !bin_sizes[last_bin + 1]; --last_bin) { } ++ //This dominates runtime, mostly in the swap and bin lookups ++ for(unsigned u = 0; u < last_bin; ++u) { ++ local_bin = bins + u; ++ nextbinstart += bin_sizes[u + 1]; ++ //Iterating over each element in this bin ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //Swapping elements in current into place until the correct element has been swapped in ++ for(target_bin = bins + getchar((*current), char_offset); target_bin != local_bin; ++ target_bin = bins + getchar((*current), char_offset)) ++ iter_swap(current, (*target_bin)++); ++ } ++ *local_bin = nextbinstart; ++ } ++ bins[last_bin] = last; ++ ++ //Recursing ++ RandomAccessIter lastPos = bin_cache[cache_offset]; ++ //Skip this loop for empties ++ for(unsigned u = cache_offset + 1; u < cache_offset + last_bin + 2; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ //don't sort unless there are at least two items to compare ++ if(count < 2) ++ continue; ++ //using std::sort if its worst-case is better ++ if(count < max_size) ++ std::sort(lastPos, bin_cache[u], comp); ++ else ++ string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(lastPos ++ , bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes, getchar, length, comp); ++ } ++ } ++ ++ //Sorts strings in reverse order, with empties at the end ++ template <class RandomAccessIter, class data_type, class unsignedchar_type, class get_char, class get_length, class compare> ++ inline void ++ reverse_string_sort_rec(RandomAccessIter first, RandomAccessIter last, unsigned char_offset, std::vector<RandomAccessIter> &bin_cache ++ , unsigned cache_offset, std::vector<size_t> &bin_sizes, get_char getchar, get_length length, compare comp) ++ { ++ //This section is not strictly necessary, but makes handling of long identical substrings much faster, with a mild average performance impact. ++ RandomAccessIter curr = first; ++ //Iterate to the end of the empties. If all empty, return ++ while(length(*curr) <= char_offset) { ++ if(++curr == last) ++ return; ++ } ++ //Getting the last non-empty ++ while(length(*(--last)) <= char_offset) { } ++ ++last; ++ //Offsetting on identical characters. This section works a character at a time for optimal worst-case performance. ++ update_offset(first, last, char_offset, getchar, length); ++ ++ const unsigned bin_count = (1 << (sizeof(unsignedchar_type)*8)); ++ //Equal worst-case between radix and comparison-based is when bin_count = n*log(n). ++ const unsigned max_size = bin_count; ++ const unsigned membin_count = bin_count + 1; ++ const unsigned max_bin = bin_count - 1; ++ unsigned cache_end; ++ RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, membin_count); ++ RandomAccessIter *end_bin = &(bin_cache[cache_offset + max_bin]); ++ ++ //Calculating the size of each bin; this takes roughly 10% of runtime ++ for (RandomAccessIter current = first; current != last; ++current) { ++ if(length(*current) <= char_offset) { ++ bin_sizes[bin_count]++; ++ } ++ else ++ bin_sizes[max_bin - getchar((*current), char_offset)]++; ++ } ++ //Assign the bin positions ++ bin_cache[cache_offset] = first; ++ for(unsigned u = 0; u < membin_count - 1; u++) ++ bin_cache[cache_offset + u + 1] = bin_cache[cache_offset + u] + bin_sizes[u]; ++ ++ //Swap into place ++ RandomAccessIter nextbinstart = last; ++ //handling empty bins ++ RandomAccessIter * local_bin = &(bin_cache[cache_offset + bin_count]); ++ RandomAccessIter lastFull = *local_bin; ++ RandomAccessIter * target_bin; ++ //Iterating over each element in the bin of empties ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //empties belong in this bin ++ while(length(*current) > char_offset) { ++ target_bin = end_bin - getchar((*current), char_offset); ++ iter_swap(current, (*target_bin)++); ++ } ++ } ++ *local_bin = nextbinstart; ++ nextbinstart = first; ++ //iterate backwards to find the last bin with elements in it; this saves iterations in multiple loops ++ unsigned last_bin = max_bin; ++ for(; last_bin && !bin_sizes[last_bin]; --last_bin) { } ++ //This dominates runtime, mostly in the swap and bin lookups ++ for(unsigned u = 0; u < last_bin; ++u) { ++ local_bin = bins + u; ++ nextbinstart += bin_sizes[u]; ++ //Iterating over each element in this bin ++ for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { ++ //Swapping elements in current into place until the correct element has been swapped in ++ for(target_bin = end_bin - getchar((*current), char_offset); target_bin != local_bin; ++ target_bin = end_bin - getchar((*current), char_offset)) ++ iter_swap(current, (*target_bin)++); ++ } ++ *local_bin = nextbinstart; ++ } ++ bins[last_bin] = lastFull; ++ //Recursing ++ RandomAccessIter lastPos = first; ++ //Skip this loop for empties ++ for(unsigned u = cache_offset; u <= cache_offset + last_bin; lastPos = bin_cache[u], ++u) { ++ size_t count = bin_cache[u] - lastPos; ++ //don't sort unless there are at least two items to compare ++ if(count < 2) ++ continue; ++ //using std::sort if its worst-case is better ++ if(count < max_size) ++ std::sort(lastPos, bin_cache[u], comp); ++ else ++ reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(lastPos ++ , bin_cache[u], char_offset + 1, bin_cache, cache_end, bin_sizes, getchar, length, comp); ++ } ++ } ++ ++ //Holds the bin vector and makes the initial recursive call ++ template <class RandomAccessIter, class data_type, class unsignedchar_type> ++ inline void ++ string_sort(RandomAccessIter first, RandomAccessIter last, data_type, unsignedchar_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(first, last, 0, bin_cache, 0, bin_sizes); ++ } ++ ++ //Holds the bin vector and makes the initial recursive call ++ template <class RandomAccessIter, class data_type, class unsignedchar_type> ++ inline void ++ reverse_string_sort(RandomAccessIter first, RandomAccessIter last, data_type, unsignedchar_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type>(first, last, 0, bin_cache, 0, bin_sizes); ++ } ++ ++ //Holds the bin vector and makes the initial recursive call ++ template <class RandomAccessIter, class get_char, class get_length, class data_type, class unsignedchar_type> ++ inline void ++ string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, data_type, unsignedchar_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length>(first, last, 0, bin_cache, 0, bin_sizes, getchar, length); ++ } ++ ++ //Holds the bin vector and makes the initial recursive call ++ template <class RandomAccessIter, class get_char, class get_length, class compare, class data_type, class unsignedchar_type> ++ inline void ++ string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp, data_type, unsignedchar_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(first, last, 0, bin_cache, 0, bin_sizes, getchar, length, comp); ++ } ++ ++ //Holds the bin vector and makes the initial recursive call ++ template <class RandomAccessIter, class get_char, class get_length, class compare, class data_type, class unsignedchar_type> ++ inline void ++ reverse_string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp, data_type, unsignedchar_type) ++ { ++ std::vector<size_t> bin_sizes; ++ std::vector<RandomAccessIter> bin_cache; ++ reverse_string_sort_rec<RandomAccessIter, data_type, unsignedchar_type, get_char, get_length, compare>(first, last, 0, bin_cache, 0, bin_sizes, getchar, length, comp); ++ } ++ } ++ ++ //Allows character-type overloads ++ template <class RandomAccessIter, class unsignedchar_type> ++ inline void string_sort(RandomAccessIter first, RandomAccessIter last, unsignedchar_type unused) ++ { ++ //Don't sort if it's too small to optimize ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last); ++ else ++ detail::string_sort(first, last, *first, unused); ++ } ++ ++ //Top-level sorting call; wraps using default of unsigned char ++ template <class RandomAccessIter> ++ inline void string_sort(RandomAccessIter first, RandomAccessIter last) ++ { ++ unsigned char unused = '\0'; ++ string_sort(first, last, unused); ++ } ++ ++ //Allows character-type overloads ++ template <class RandomAccessIter, class compare, class unsignedchar_type> ++ inline void reverse_string_sort(RandomAccessIter first, RandomAccessIter last, compare comp, unsignedchar_type unused) ++ { ++ //Don't sort if it's too small to optimize ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last, comp); ++ else ++ detail::reverse_string_sort(first, last, *first, unused); ++ } ++ ++ //Top-level sorting call; wraps using default of unsigned char ++ template <class RandomAccessIter, class compare> ++ inline void reverse_string_sort(RandomAccessIter first, RandomAccessIter last, compare comp) ++ { ++ unsigned char unused = '\0'; ++ reverse_string_sort(first, last, comp, unused); ++ } ++ ++ template <class RandomAccessIter, class get_char, class get_length> ++ inline void string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length) ++ { ++ //Don't sort if it's too small to optimize ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last); ++ else { ++ //skipping past empties at the beginning, which allows us to get the character type ++ //.empty() is not used so as not to require a user declaration of it ++ while(!length(*first)) { ++ if(++first == last) ++ return; ++ } ++ detail::string_sort(first, last, getchar, length, *first, getchar((*first), 0)); ++ } ++ } ++ ++ template <class RandomAccessIter, class get_char, class get_length, class compare> ++ inline void string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp) ++ { ++ //Don't sort if it's too small to optimize ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last, comp); ++ else { ++ //skipping past empties at the beginning, which allows us to get the character type ++ //.empty() is not used so as not to require a user declaration of it ++ while(!length(*first)) { ++ if(++first == last) ++ return; ++ } ++ detail::string_sort(first, last, getchar, length, comp, *first, getchar((*first), 0)); ++ } ++ } ++ ++ template <class RandomAccessIter, class get_char, class get_length, class compare> ++ inline void reverse_string_sort(RandomAccessIter first, RandomAccessIter last, get_char getchar, get_length length, compare comp) ++ { ++ //Don't sort if it's too small to optimize ++ if(last - first < detail::MIN_SORT_SIZE) ++ std::sort(first, last, comp); ++ else { ++ //skipping past empties at the beginning, which allows us to get the character type ++ //.empty() is not used so as not to require a user declaration of it ++ while(!length(*(--last))) { ++ //Note: if there is just one non-empty, and it's at the beginning, then it's already in sorted order ++ if(first == last) ++ return; ++ } ++ //making last just after the end of the non-empty part of the array ++ ++last; ++ detail::reverse_string_sort(first, last, getchar, length, comp, *first, getchar((*first), 0)); ++ } ++ } ++} ++ ++#endif diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc deleted file mode 100644 index c04bb16cf17..00000000000 --- a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc +++ /dev/null @@ -1,39 +0,0 @@ -$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc,v 1.4 2013/11/04 06:01:46 ryoon Exp $ - ---- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc.orig 2013-10-29 01:21:06.000000000 +0000 -+++ mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc -@@ -278,20 +278,34 @@ bool ThreadPosix::SetAffinity(const int* - } - #if defined(__FreeBSD__) - cpuset_t mask; -+#elif defined(__NetBSD__) -+ cpuset_t *mask; - #else - cpu_set_t mask; - #endif -+#if defined(__NetBSD__) -+ cpuset_zero(mask); -+#else - CPU_ZERO(&mask); -+#endif - - for (unsigned int processor = 0; - processor < amount_of_processors; - ++processor) { -+#if defined(__NetBSD__) -+ cpuset_set(processor_numbers[processor], mask); -+#else - CPU_SET(processor_numbers[processor], &mask); -+#endif - } - #if defined(__FreeBSD__) - const int result = pthread_setaffinity_np(thread_, - sizeof(mask), - &mask); -+#elif defined(__NetBSD__) -+ const int result = pthread_setaffinity_np(thread_, -+ sizeof(mask), -+ mask); - #elif defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK) - // Android. - const int result = syscall(__NR_sched_setaffinity, diff --git a/www/seamonkey/patches/patch-mozilla_memory_mozalloc_fallible.h b/www/seamonkey/patches/patch-mozilla_memory_mozalloc_fallible.h new file mode 100644 index 00000000000..1b9e471aa48 --- /dev/null +++ b/www/seamonkey/patches/patch-mozilla_memory_mozalloc_fallible.h @@ -0,0 +1,28 @@ +$NetBSD: patch-mozilla_memory_mozalloc_fallible.h,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mozilla/memory/mozalloc/fallible.h.orig 2013-12-11 04:29:01.000000000 +0000 ++++ mozilla/memory/mozalloc/fallible.h +@@ -5,9 +5,22 @@ + #ifndef mozilla_fallible_h + #define mozilla_fallible_h + ++#if defined(MOZALLOC_EXPORT) ++/* do nothing: it's been defined to __declspec(dllexport) by ++ * mozalloc*.cpp on platforms where that's required. */ ++#elif defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec)) ++# define MOZALLOC_EXPORT __declspec(dllimport) ++#elif defined(HAVE_VISIBILITY_ATTRIBUTE) ++/* Make sure symbols are still exported even if we're wrapped in a ++ * |visibility push(hidden)| blanket. */ ++# define MOZALLOC_EXPORT __attribute__ ((visibility ("default"))) ++#else ++# define MOZALLOC_EXPORT ++#endif ++ + namespace mozilla { + +-struct fallible_t { }; ++struct MOZALLOC_EXPORT fallible_t { }; + + } // namespace mozilla + diff --git a/www/seamonkey/patches/patch-mozilla_memory_mozalloc_mozalloc.cpp b/www/seamonkey/patches/patch-mozilla_memory_mozalloc_mozalloc.cpp new file mode 100644 index 00000000000..78e543353f8 --- /dev/null +++ b/www/seamonkey/patches/patch-mozilla_memory_mozalloc_mozalloc.cpp @@ -0,0 +1,81 @@ +$NetBSD: patch-mozilla_memory_mozalloc_mozalloc.cpp,v 1.3 2013/12/26 13:17:37 ryoon Exp $ + +--- mozilla/memory/mozalloc/mozalloc.cpp.orig 2013-12-11 04:29:01.000000000 +0000 ++++ mozilla/memory/mozalloc/mozalloc.cpp +@@ -229,3 +229,76 @@ namespace mozilla { + const fallible_t fallible = fallible_t(); + + } // namespace mozilla ++ ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC ++{ ++ return moz_xmalloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC ++{ ++ return moz_xmalloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ return moz_malloc(size); ++} ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ moz_free(ptr); ++} ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS ++{ ++ moz_free(ptr); ++} diff --git a/www/seamonkey/patches/patch-mozilla_memory_mozalloc_mozalloc.h b/www/seamonkey/patches/patch-mozilla_memory_mozalloc_mozalloc.h new file mode 100644 index 00000000000..90ec1c44860 --- /dev/null +++ b/www/seamonkey/patches/patch-mozilla_memory_mozalloc_mozalloc.h @@ -0,0 +1,154 @@ +$NetBSD: patch-mozilla_memory_mozalloc_mozalloc.h,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mozilla/memory/mozalloc/mozalloc.h.orig 2013-12-11 04:29:02.000000000 +0000 ++++ mozilla/memory/mozalloc/mozalloc.h +@@ -39,15 +39,6 @@ + # define MOZALLOC_EXPORT + #endif + +- +-#if defined(MOZ_ALWAYS_INLINE_EVEN_DEBUG) +-# define MOZALLOC_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG +-#elif defined(HAVE_FORCEINLINE) +-# define MOZALLOC_INLINE __forceinline +-#else +-# define MOZALLOC_INLINE inline +-#endif +- + /* Workaround build problem with Sun Studio 12 */ + #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) + # undef NS_WARN_UNUSED_RESULT +@@ -171,15 +162,6 @@ MOZALLOC_EXPORT void* moz_valloc(size_t + * that |::operator new() throw(std::bad_alloc)| will never return NULL. + */ + +-/* NB: This is defined just to silence vacuous warnings about symbol +- * visibility on OS X/gcc. These symbols are force-inline and not +- * exported. */ +-#if defined(XP_MACOSX) +-# define MOZALLOC_EXPORT_NEW MOZALLOC_EXPORT +-#else +-# define MOZALLOC_EXPORT_NEW +-#endif +- + #if defined(ANDROID) || defined(_MSC_VER) + /* + * Android doesn't fully support exceptions, so its <new> header +@@ -195,53 +177,29 @@ MOZALLOC_EXPORT void* moz_valloc(size_t + + #define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS + +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC +-{ +- return moz_xmalloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC +-{ +- return moz_xmalloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} +- +-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE +-void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_free(ptr); +-} ++MOZALLOC_EXPORT ++void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC; ++ ++MOZALLOC_EXPORT ++void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC; ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; + + + /* +@@ -263,29 +221,17 @@ void operator delete[](void* ptr, const + * (4) the matching system |operator delete(void*) throw(std::bad_alloc)| + */ + +-MOZALLOC_INLINE +-void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_INLINE +-void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- return moz_malloc(size); +-} +- +-MOZALLOC_INLINE +-void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- moz_free(ptr); +-} +- +-MOZALLOC_INLINE +-void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS +-{ +- moz_free(ptr); +-} ++MOZALLOC_EXPORT ++void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; ++ ++MOZALLOC_EXPORT ++void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS; + + #endif /* ifdef __cplusplus */ + diff --git a/www/seamonkey/patches/patch-mozilla_mfbt_Atomics.h b/www/seamonkey/patches/patch-mozilla_mfbt_Atomics.h deleted file mode 100644 index 9e1b88ffb55..00000000000 --- a/www/seamonkey/patches/patch-mozilla_mfbt_Atomics.h +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-mozilla_mfbt_Atomics.h,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/mfbt/Atomics.h.orig 2013-09-16 18:26:51.000000000 +0000 -+++ mozilla/mfbt/Atomics.h -@@ -37,7 +37,7 @@ - */ - # if !defined(__linux__) && !defined(__OpenBSD__) && \ - (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \ -- __has_include(<atomic>) -+ __has_include_next(<atomic>) - # define MOZ_HAVE_CXX11_ATOMICS - # endif - /* diff --git a/www/seamonkey/patches/patch-mozilla_modules_libpref_src_init_all.js b/www/seamonkey/patches/patch-mozilla_modules_libpref_src_init_all.js deleted file mode 100644 index 306981343be..00000000000 --- a/www/seamonkey/patches/patch-mozilla_modules_libpref_src_init_all.js +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-mozilla_modules_libpref_src_init_all.js,v 1.1 2013/09/28 14:37:05 ryoon Exp $ - ---- mozilla/modules/libpref/src/init/all.js.orig 2013-09-16 18:26:53.000000000 +0000 -+++ mozilla/modules/libpref/src/init/all.js -@@ -188,7 +188,7 @@ pref("media.webm.enabled", true); - pref("media.dash.enabled", false); - #endif - #ifdef MOZ_GSTREAMER --pref("media.gstreamer.enabled", false); -+pref("media.gstreamer.enabled", true); - #endif - #ifdef MOZ_WEBRTC - pref("media.navigator.enabled", true); diff --git a/www/seamonkey/patches/patch-mozilla_netwerk_wifi_moz.build b/www/seamonkey/patches/patch-mozilla_netwerk_wifi_moz.build index 5abd05c5b43..d40019623bc 100644 --- a/www/seamonkey/patches/patch-mozilla_netwerk_wifi_moz.build +++ b/www/seamonkey/patches/patch-mozilla_netwerk_wifi_moz.build @@ -1,8 +1,8 @@ -$NetBSD: patch-mozilla_netwerk_wifi_moz.build,v 1.2 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_netwerk_wifi_moz.build,v 1.3 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/netwerk/wifi/moz.build.orig 2013-10-29 01:21:08.000000000 +0000 +--- mozilla/netwerk/wifi/moz.build.orig 2013-12-11 04:29:10.000000000 +0000 +++ mozilla/netwerk/wifi/moz.build -@@ -34,6 +34,14 @@ if CONFIG['OS_ARCH'] == 'Darwin': +@@ -38,6 +38,10 @@ if CONFIG['OS_ARCH'] == 'Darwin': CMMSRCS += [ 'osx_corewlan.mm', ] @@ -10,10 +10,6 @@ $NetBSD: patch-mozilla_netwerk_wifi_moz.build,v 1.2 2013/11/04 06:01:46 ryoon Ex + CPP_SOURCES += [ + 'nsWifiScannerFreeBSD.cpp', + ] -+elif CONFIG['OS_ARCH'] == 'FreeBSD': -+ CPP_SOURCES += [ -+ 'nsWifiScannerFreeBSD.cpp', -+ ] elif CONFIG['OS_ARCH'] == 'WINNT': CPP_SOURCES += [ 'nsWifiScannerWin.cpp', diff --git a/www/seamonkey/patches/patch-mozilla_toolkit_library_Makefile.in b/www/seamonkey/patches/patch-mozilla_toolkit_library_Makefile.in index c1f42ff6f58..2619f02271e 100644 --- a/www/seamonkey/patches/patch-mozilla_toolkit_library_Makefile.in +++ b/www/seamonkey/patches/patch-mozilla_toolkit_library_Makefile.in @@ -1,8 +1,8 @@ -$NetBSD: patch-mozilla_toolkit_library_Makefile.in,v 1.1 2013/05/23 13:25:30 ryoon Exp $ +$NetBSD: patch-mozilla_toolkit_library_Makefile.in,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/toolkit/library/Makefile.in.orig 2013-05-03 03:08:13.000000000 +0000 +--- mozilla/toolkit/library/Makefile.in.orig 2013-12-11 04:29:15.000000000 +0000 +++ mozilla/toolkit/library/Makefile.in -@@ -405,6 +405,7 @@ endif +@@ -399,6 +399,7 @@ endif EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib) ifdef MOZ_WEBRTC @@ -10,3 +10,14 @@ $NetBSD: patch-mozilla_toolkit_library_Makefile.in,v 1.1 2013/05/23 13:25:30 ryo ifdef MOZ_PEERCONNECTION COMPONENT_LIBS += peerconnection endif +@@ -541,6 +542,10 @@ OS_LIBS += $(call EXPAND_LIBNAME,kvm) + EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols + endif + ++ifeq ($(OS_ARCH),FreeBSD) ++OS_LIBS += $(call EXPAND_LIBNAME,util) ++endif ++ + ifeq ($(OS_ARCH),WINNT) + OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet) + ifdef ACCESSIBILITY diff --git a/www/seamonkey/patches/patch-mozilla_toolkit_toolkit.mozbuild b/www/seamonkey/patches/patch-mozilla_toolkit_toolkit.mozbuild index 6a2a5783833..567759b1158 100644 --- a/www/seamonkey/patches/patch-mozilla_toolkit_toolkit.mozbuild +++ b/www/seamonkey/patches/patch-mozilla_toolkit_toolkit.mozbuild @@ -1,12 +1,14 @@ -$NetBSD: patch-mozilla_toolkit_toolkit.mozbuild,v 1.1 2013/07/12 12:24:11 ryoon Exp $ +$NetBSD: patch-mozilla_toolkit_toolkit.mozbuild,v 1.2 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/toolkit/toolkit.mozbuild.orig 2013-06-20 04:35:23.000000000 +0000 +--- mozilla/toolkit/toolkit.mozbuild.orig 2013-12-11 04:29:23.000000000 +0000 +++ mozilla/toolkit/toolkit.mozbuild -@@ -46,7 +46,7 @@ if CONFIG['MOZ_UPDATER']: - if not CONFIG['MOZ_NATIVE_BZ2']: - add_tier_dir('platform', 'modules/libbz2') +@@ -43,8 +43,8 @@ add_tier_dir('platform', [ + if CONFIG['MOZ_AUTH_EXTENSION']: + add_tier_dir('platform', 'extensions/auth') +-if CONFIG['MOZ_UPDATER']: - add_tier_dir('platform', 'other-licenses/bsdiff') ++#if CONFIG['MOZ_UPDATER']: +# add_tier_dir('platform', 'other-licenses/bsdiff') # Gecko/Core components. diff --git a/www/seamonkey/patches/patch-mozilla_xpcom_base_nsMemoryInfoDumper.cpp b/www/seamonkey/patches/patch-mozilla_xpcom_base_nsMemoryInfoDumper.cpp new file mode 100644 index 00000000000..78f8da3b063 --- /dev/null +++ b/www/seamonkey/patches/patch-mozilla_xpcom_base_nsMemoryInfoDumper.cpp @@ -0,0 +1,31 @@ +$NetBSD: patch-mozilla_xpcom_base_nsMemoryInfoDumper.cpp,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mozilla/xpcom/base/nsMemoryInfoDumper.cpp.orig 2013-12-11 04:29:24.000000000 +0000 ++++ mozilla/xpcom/base/nsMemoryInfoDumper.cpp +@@ -30,7 +30,7 @@ + #include <unistd.h> + #endif + +-#ifdef XP_LINUX ++#if defined(XP_LINUX) || defined(__FreeBSD__) + #include <fcntl.h> + #include <sys/types.h> + #include <sys/stat.h> +@@ -109,7 +109,7 @@ private: + + } // anonymous namespace + +-#ifdef XP_LINUX // { ++#if defined(XP_LINUX) || defined(__FreeBSD__) // { + namespace { + + /* +@@ -548,7 +548,7 @@ nsMemoryInfoDumper::~nsMemoryInfoDumper( + /* static */ void + nsMemoryInfoDumper::Initialize() + { +-#ifdef XP_LINUX ++#if defined(XP_LINUX) || defined(__FreeBSD__) + SignalPipeWatcher::Create(); + FifoWatcher::MaybeCreate(); + #endif diff --git a/www/seamonkey/patches/patch-mozilla_xpcom_base_nsMemoryReporterManager.cpp b/www/seamonkey/patches/patch-mozilla_xpcom_base_nsMemoryReporterManager.cpp new file mode 100644 index 00000000000..0f49948598f --- /dev/null +++ b/www/seamonkey/patches/patch-mozilla_xpcom_base_nsMemoryReporterManager.cpp @@ -0,0 +1,106 @@ +$NetBSD: patch-mozilla_xpcom_base_nsMemoryReporterManager.cpp,v 1.1 2013/12/26 13:17:37 ryoon Exp $ + +--- mozilla/xpcom/base/nsMemoryReporterManager.cpp.orig 2013-12-11 04:29:24.000000000 +0000 ++++ mozilla/xpcom/base/nsMemoryReporterManager.cpp +@@ -196,6 +196,43 @@ static nsresult GetResidentFast(int64_t* + return GetResident(aN); + } + ++#ifdef __FreeBSD__ ++#include <libutil.h> ++ ++static nsresult ++GetKinfoVmentrySelf(int64_t* prss) ++{ ++ int cnt; ++ struct kinfo_vmentry *vmmap, *kve; ++ if ((vmmap = kinfo_getvmmap(getpid(), &cnt)) == NULL) ++ return NS_ERROR_FAILURE; ++ ++ if (prss) ++ *prss = 0; ++ ++ for (int i = 0; i < cnt; i++) { ++ kve = &vmmap[i]; ++ if (prss) ++ *prss += kve->kve_private_resident; ++ } ++ ++ free(vmmap); ++ return NS_OK; ++} ++ ++#define HAVE_PRIVATE_REPORTER ++static nsresult ++GetPrivate(int64_t* aN) ++{ ++ int64_t priv; ++ nsresult rv = GetKinfoVmentrySelf(&priv); ++ if (NS_SUCCEEDED(rv)) ++ *aN = priv * getpagesize(); ++ ++ return NS_OK; ++} ++#endif // FreeBSD ++ + #elif defined(SOLARIS) + + #include <procfs.h> +@@ -370,6 +407,24 @@ static nsresult GetResidentFast(int64_t* + } + + #define HAVE_PRIVATE_REPORTER ++static nsresult ++GetPrivate(int64_t* aN) ++{ ++ PROCESS_MEMORY_COUNTERS_EX pmcex; ++ pmcex.cb = sizeof(PROCESS_MEMORY_COUNTERS_EX); ++ ++ if (!GetProcessMemoryInfo( ++ GetCurrentProcess(), ++ (PPROCESS_MEMORY_COUNTERS) &pmcex, sizeof(pmcex))) { ++ return NS_ERROR_FAILURE; ++ } ++ ++ *aN = pmcex.PrivateUsage; ++ return NS_OK; ++} ++#endif // XP_<PLATFORM> ++ ++#ifdef HAVE_PRIVATE_REPORTER + class PrivateReporter MOZ_FINAL : public MemoryUniReporter + { + public: +@@ -382,21 +437,10 @@ public: + + NS_IMETHOD GetAmount(int64_t* aAmount) + { +- PROCESS_MEMORY_COUNTERS_EX pmcex; +- pmcex.cb = sizeof(PROCESS_MEMORY_COUNTERS_EX); +- +- if (!GetProcessMemoryInfo( +- GetCurrentProcess(), +- (PPROCESS_MEMORY_COUNTERS) &pmcex, sizeof(pmcex))) { +- return NS_ERROR_FAILURE; +- } +- +- *aAmount = pmcex.PrivateUsage; +- return NS_OK; ++ return GetPrivate(aAmount); + } + }; +- +-#endif // XP_<PLATFORM> ++#endif + + #ifdef HAVE_VSIZE_AND_RESIDENT_REPORTERS + class VsizeReporter MOZ_FINAL : public MemoryUniReporter +@@ -780,7 +824,7 @@ nsMemoryReporterManager::Init() + RegisterReporter(new mozilla::dmd::DMDReporter); + #endif + +-#if defined(XP_LINUX) ++#if defined(XP_LINUX) || defined(__FreeBSD__) + nsMemoryInfoDumper::Initialize(); + #endif + diff --git a/www/seamonkey/patches/patch-mozilla_xpcom_ds_moz.build b/www/seamonkey/patches/patch-mozilla_xpcom_ds_moz.build index 13953644222..1f1b49cda2d 100644 --- a/www/seamonkey/patches/patch-mozilla_xpcom_ds_moz.build +++ b/www/seamonkey/patches/patch-mozilla_xpcom_ds_moz.build @@ -1,16 +1,16 @@ -$NetBSD: patch-mozilla_xpcom_ds_moz.build,v 1.2 2013/11/04 06:01:46 ryoon Exp $ +$NetBSD: patch-mozilla_xpcom_ds_moz.build,v 1.3 2013/12/26 13:17:37 ryoon Exp $ ---- mozilla/xpcom/ds/moz.build.orig 2013-10-29 01:21:14.000000000 +0000 +--- mozilla/xpcom/ds/moz.build.orig 2013-12-11 04:29:24.000000000 +0000 +++ mozilla/xpcom/ds/moz.build -@@ -95,7 +95,6 @@ CPP_SOURCES += [ +@@ -90,7 +90,6 @@ CPP_SOURCES += [ + 'nsSupportsArrayEnumerator.cpp', 'nsSupportsPrimitives.cpp', - 'nsUnicharBuffer.cpp', 'nsVariant.cpp', - 'TimeStamp.cpp', ] if CONFIG['OS_ARCH'] == 'WINNT': -@@ -113,6 +112,10 @@ elif CONFIG['OS_ARCH'] == 'Darwin': +@@ -108,6 +107,10 @@ elif CONFIG['OS_ARCH'] == 'Darwin': else: error('No TimeStamp implementation on this platform. Build will not succeed') |