Repository.mk | 8 ++--- RepositoryExternal.mk | 2 - avmedia/Library_avmedia.mk | 2 - chart2/Library_chartcore.mk | 2 - config_host.mk.in | 2 - configure.ac | 6 ++-- cui/Library_cui.mk | 2 - desktop/Executable_oosplash.mk | 2 - desktop/Library_sofficeapp.mk | 4 +- desktop/Module_desktop.mk | 2 - emfio/CppunitTest_emfio_wmf_test.mk | 4 +- external/cairo/ExternalProject_cairo.mk | 2 - postprocess/Module_postprocess.mk | 2 - postprocess/Rdb_services.mk | 6 ++-- sal/osl/unx/file.cxx | 8 ++--- sal/osl/unx/file_misc.cxx | 10 +++---- sal/osl/unx/profile.cxx | 8 ++--- sal/osl/unx/socket.cxx | 2 - sal/osl/unx/thread.cxx | 6 ++-- sal/osl/w32/file.cxx | 8 ++--- sal/osl/w32/file_dirvol.cxx | 34 ++++++++++++------------- sal/osl/w32/file_url.cxx | 14 +++++----- sal/osl/w32/path_helper.hxx | 4 +- sal/osl/w32/pipe.cxx | 10 +++---- sal/osl/w32/process.cxx | 4 +- sal/osl/w32/procimpl.cxx | 2 - sal/osl/w32/socket.cxx | 12 ++++---- sal/osl/w32/thread.cxx | 6 ++-- sal/rtl/bootstrap.cxx | 4 +- sal/rtl/byteseq.cxx | 18 ++++++------- sal/rtl/cipher.cxx | 4 +- sal/rtl/cmdargs.cxx | 2 - sal/rtl/digest.cxx | 13 +++++---- sal/rtl/locale.cxx | 26 +++++++++---------- sal/rtl/math.cxx | 4 +- sal/rtl/strimp.cxx | 10 +++---- sal/rtl/strimp.hxx | 2 - sc/Module_sc.mk | 2 - sd/Module_sd.mk | 2 - slideshow/Library_slideshow.mk | 2 - solenv/gbuild/Gallery.mk | 2 - solenv/gbuild/PythonTest.mk | 2 - solenv/gbuild/UITest.mk | 2 - solenv/gbuild/extensions/pre_MergedLibsList.mk | 2 - solenv/gbuild/gbuild.mk | 2 - svx/Executable_gengal.mk | 2 - svx/Library_svxcore.mk | 2 - sw/CppunitTest_sw_mailmerge.mk | 2 - sw/CppunitTest_sw_odfimport.mk | 2 - sw/Module_sw.mk | 2 - toolkit/Library_tk.mk | 2 - vcl/CppunitTest_vcl_bitmap_test.mk | 2 - vcl/Executable_icontest.mk | 2 - vcl/Executable_vcldemo.mk | 2 - vcl/Library_vcl.mk | 6 ++-- vcl/Module_vcl.mk | 6 ++-- 56 files changed, 152 insertions(+), 151 deletions(-)
New commits: commit 2b5812e0191d43bff939274d88e7ec3ce02ce6cd Author: Noel Grandin <[email protected]> AuthorDate: Sun Aug 26 17:22:56 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Aug 27 08:47:49 2018 +0200 rename ENABLE_HEADLESS option to DISABLE_GUI since it has nothing to do with the headless command line option, so use the name it has in the configure.ac file Change-Id: Ibf0615ed02695d6e48a797f5632e4f417c010c70 Reviewed-on: https://gerrit.libreoffice.org/59611 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/Repository.mk b/Repository.mk index b5c0b5b151a1..fdcb6115c507 100644 --- a/Repository.mk +++ b/Repository.mk @@ -200,7 +200,7 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,ooo, \ gengal \ $(if $(filter WNT,$(OS)),,uri-encode) \ $(if $(ENABLE_MACOSX_SANDBOX),, \ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ ui-previewer \ ) \ ) \ @@ -429,7 +429,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ slideshow \ sot \ spell \ - $(if $(ENABLE_HEADLESS),,spl) \ + $(if $(DISABLE_GUI),,spl) \ storagefd \ $(call gb_Helper_optional,SCRIPTING,stringresource) \ svgio \ @@ -962,7 +962,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo,\ $(eval $(call gb_Helper_register_packages_for_install,ooo_fonts,\ extras_fonts \ - $(if $(USING_X11)$(ENABLE_HEADLESS)$(filter ANDROID,$(OS)), \ + $(if $(USING_X11)$(DISABLE_GUI)$(filter ANDROID,$(OS)), \ postprocess_fontconfig) \ $(call gb_Helper_optional,MORE_FONTS,\ fonts_alef \ @@ -1017,7 +1017,7 @@ $(eval $(call gb_Helper_register_packages_for_install,brand,\ $(if $(CUSTOM_BRAND_DIR),desktop_branding_custom) \ $(if $(filter DESKTOP,$(BUILD_TYPE)),desktop_scripts_install) \ $(if $(and $(filter-out MACOSX WNT,$(OS)),$(filter DESKTOP,$(BUILD_TYPE))),\ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ desktop_soffice_sh \ ) \ ) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index fa19152cd6fb..6852ff356a9e 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1220,7 +1220,7 @@ endif # ANDROID endif # SYSTEM_REDLAND -ifneq ($(USING_X11)$(ENABLE_CAIRO_CANVAS)$(ENABLE_HEADLESS),) # or +ifneq ($(USING_X11)$(ENABLE_CAIRO_CANVAS)$(DISABLE_GUI),) # or ifneq ($(SYSTEM_CAIRO),) diff --git a/avmedia/Library_avmedia.mk b/avmedia/Library_avmedia.mk index 1f4c5246b651..2bec95c47e2d 100644 --- a/avmedia/Library_avmedia.mk +++ b/avmedia/Library_avmedia.mk @@ -38,7 +38,7 @@ $(eval $(call gb_Library_use_externals,avmedia,\ boost_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,avmedia,\ epoxy \ )) diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index c23c4a046f3a..4f98fc121251 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -29,7 +29,7 @@ $(eval $(call gb_Library_use_externals,chartcore,\ boost_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,chartcore,\ epoxy \ )) diff --git a/config_host.mk.in b/config_host.mk.in index 17c1341c29a5..0d87b7dfb535 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -141,7 +141,7 @@ export ENABLE_GSTREAMER_1_0=@ENABLE_GSTREAMER_1_0@ export ENABLE_GTK3=@ENABLE_GTK3@ export ENABLE_GTK=@ENABLE_GTK@ export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@ -export ENABLE_HEADLESS=@ENABLE_HEADLESS@ +export DISABLE_GUI=@DISABLE_GUI@ export ENABLE_HTMLHELP=@ENABLE_HTMLHELP@ export ENABLE_JAVA=@ENABLE_JAVA@ export ENABLE_KDE4=@ENABLE_KDE4@ diff --git a/configure.ac b/configure.ac index 46758b51037d..85315fa473a7 100644 --- a/configure.ac +++ b/configure.ac @@ -4413,17 +4413,17 @@ if test "$with_x" = "no"; then AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.]) fi -ENABLE_HEADLESS="" +DISABLE_GUI="" if test "$enable_gui" = "no"; then if test "$USING_X11" != TRUE; then AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.]) fi USING_X11= - ENABLE_HEADLESS=TRUE + DISABLE_GUI=TRUE AC_DEFINE(HAVE_FEATURE_UI,0) test_cairo=yes fi -AC_SUBST(ENABLE_HEADLESS) +AC_SUBST(DISABLE_GUI) WORKDIR="${BUILDDIR}/workdir" INSTDIR="${BUILDDIR}/instdir" diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 7ae5435fd6ed..f2926cfe43d7 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -69,7 +69,7 @@ $(eval $(call gb_Library_use_externals,cui,\ icuuc \ icu_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,cui,\ epoxy \ )) diff --git a/desktop/Executable_oosplash.mk b/desktop/Executable_oosplash.mk index 365b58fdab5e..a14acd626b74 100644 --- a/desktop/Executable_oosplash.mk +++ b/desktop/Executable_oosplash.mk @@ -35,7 +35,7 @@ $(eval $(call gb_Executable_add_libs,oosplash,\ endif -ifneq ($(ENABLE_HEADLESS),TRUE) +ifneq ($(DISABLE_GUI),TRUE) ifneq ($(OS),WNT) $(eval $(call gb_Executable_add_libs,oosplash,\ diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk index 288e26d47726..38e427d66173 100644 --- a/desktop/Library_sofficeapp.mk +++ b/desktop/Library_sofficeapp.mk @@ -123,7 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\ desktop/source/migration/migration \ )) -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_Library_add_libs,sofficeapp,\ -lm $(DLOPEN_LIBS) \ -lpthread \ @@ -161,7 +161,7 @@ $(eval $(call gb_Library_add_exception_objects,sofficeapp,\ desktop/source/lib/lokclipboard \ )) endif -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_Library_add_exception_objects,sofficeapp,\ desktop/source/lib/init \ desktop/source/lib/lokinteractionhandler \ diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk index 086e51e6ea26..dfb9542a6401 100644 --- a/desktop/Module_desktop.mk +++ b/desktop/Module_desktop.mk @@ -20,7 +20,7 @@ $(eval $(call gb_Module_add_targets,desktop,\ $(if $(ENABLE_BREAKPAD), \ Library_crashreport \ ) \ - $(if $(ENABLE_HEADLESS),,Library_spl) \ + $(if $(DISABLE_GUI),,Library_spl) \ Package_branding \ $(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \ UIConfig_deployment \ diff --git a/emfio/CppunitTest_emfio_wmf_test.mk b/emfio/CppunitTest_emfio_wmf_test.mk index 82af839c3886..f411022b46e8 100644 --- a/emfio/CppunitTest_emfio_wmf_test.mk +++ b/emfio/CppunitTest_emfio_wmf_test.mk @@ -85,7 +85,7 @@ $(eval $(call gb_CppunitTest_use_externals,emfio_wmf,\ icuuc \ lcms2 \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_CppunitTest_use_externals,emfio_wmf,\ epoxy \ )) @@ -119,7 +119,7 @@ $(eval $(call gb_CppunitTest_use_externals,emfio_wmf,\ )) endif -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_CppunitTest_use_externals,emfio_wmf,\ cairo \ freetype \ diff --git a/external/cairo/ExternalProject_cairo.mk b/external/cairo/ExternalProject_cairo.mk index c6ad07a5c0b0..ce253fd6e58b 100644 --- a/external/cairo/ExternalProject_cairo.mk +++ b/external/cairo/ExternalProject_cairo.mk @@ -54,7 +54,7 @@ $(call gb_ExternalProject_get_state_target,cairo,build) : $(if $(SYSTEM_FREETYPE),,FREETYPE_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,freetype)/include") \ $(if $(SYSTEM_FONTCONFIG),,FONTCONFIG_CFLAGS="-I$(call gb_UnpackedTarball_get_dir,fontconfig)") \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,$(if $(filter ANDROID,$(OS)),--disable-shared,--disable-static)) \ - $(if $(filter ANDROID IOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(ENABLE_HEADLESS)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \ + $(if $(filter ANDROID IOS,$(OS)),--disable-xlib --disable-xcb,$(if $(filter TRUE,$(DISABLE_GUI)),--disable-xlib --disable-xcb,--enable-xlib --enable-xcb)) \ $(if $(filter IOS,$(OS)),--enable-quartz --enable-quartz-font) \ --disable-valgrind \ $(if $(filter IOS,$(OS)),--disable-ft,--enable-ft --enable-fc) \ diff --git a/postprocess/Module_postprocess.mk b/postprocess/Module_postprocess.mk index 27cc0b940327..b02faf7b9310 100644 --- a/postprocess/Module_postprocess.mk +++ b/postprocess/Module_postprocess.mk @@ -34,7 +34,7 @@ endif # contain content from at least one of external/more_fonts/fc_local.snippet # (conditional on MORE_FONTS in BUILD_TYPE) and # extras/source/truetype/symbol/fc_local.snippet (unconditional): -ifneq ($(USING_X11)$(ENABLE_HEADLESS)$(filter ANDROID,$(OS)),) +ifneq ($(USING_X11)$(DISABLE_GUI)$(filter ANDROID,$(OS)),) $(eval $(call gb_Module_add_targets,postprocess, \ CustomTarget_fontconfig \ Package_fontconfig \ diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index b427e659439e..054af64345af 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -150,7 +150,7 @@ $(eval $(call gb_Rdb_add_components,services,\ shell/source/win32/syssh \ vcl/vcl.windows \ ) \ - $(if $(ENABLE_HEADLESS), \ + $(if $(DISABLE_GUI), \ vcl/vcl.headless \ ) \ $(if $(filter ANDROID,$(OS)), \ @@ -298,7 +298,7 @@ $(eval $(call gb_Rdb_add_components,services,\ desktop/source/migration/services/migrationoo2 \ desktop/source/migration/services/migrationoo3 \ desktop/source/offacc/offacc \ - $(if $(ENABLE_HEADLESS),,desktop/source/splash/spl) \ + $(if $(DISABLE_GUI),,desktop/source/splash/spl) \ extensions/source/abpilot/abp \ extensions/source/config/ldap/ldapbe2 \ $(if $(filter WNT,$(OS)),\ @@ -315,7 +315,7 @@ $(eval $(call gb_Rdb_add_components,services,\ shell/source/unix/exec/syssh \ ) \ $(if $(filter-out MACOSX WNT,$(OS)), \ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ shell/source/backends/desktopbe/desktopbe1 \ vcl/vcl.unx \ ) \ diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index ab21903dfd7c..96236e520652 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -50,7 +50,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\ CppunitTest_sc_cache_test \ )) -ifneq ($(ENABLE_HEADLESS),TRUE) +ifneq ($(DISABLE_GUI),TRUE) ifeq ($(OS),LINUX) $(eval $(call gb_Module_add_check_targets,sc,\ CppunitTest_sc_tiledrendering \ diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk index 495aee8d89fa..e1ead370b2e3 100644 --- a/sd/Module_sd.mk +++ b/sd/Module_sd.mk @@ -41,7 +41,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sd,\ )) endif -ifneq ($(ENABLE_HEADLESS),TRUE) +ifneq ($(DISABLE_GUI),TRUE) ifeq ($(OS),LINUX) $(eval $(call gb_Module_add_slowcheck_targets,sd,\ CppunitTest_sd_svg_export_tests \ diff --git a/slideshow/Library_slideshow.mk b/slideshow/Library_slideshow.mk index d7367458c3b0..d1526754a1fb 100644 --- a/slideshow/Library_slideshow.mk +++ b/slideshow/Library_slideshow.mk @@ -29,7 +29,7 @@ $(eval $(call gb_Library_set_precompiled_header,slideshow,$(SRCDIR)/slideshow/in $(eval $(call gb_Library_use_externals,slideshow,\ boost_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,slideshow,\ epoxy \ )) diff --git a/solenv/gbuild/Gallery.mk b/solenv/gbuild/Gallery.mk index d08fe69aef55..ef8dcc65cee5 100644 --- a/solenv/gbuild/Gallery.mk +++ b/solenv/gbuild/Gallery.mk @@ -20,7 +20,7 @@ $(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_Gallery_get_workdir,$(2))/* && \ RESPONSEFILE=$(call var2file,$(shell $(call gb_MKTEMP)),100,$(GALLERY_FILES)) && \ $(call gb_Helper_print_on_error,\ - $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(ENABLE_HEADLESS),, \ + $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(DISABLE_GUI),, \ SAL_USE_VCLPLUGIN=svp \ )) \ $(call gb_Executable_get_command,gengal,$(ICECREAM_RUN)) \ diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk index 9b0590e35d2a..c579a34ea6d5 100644 --- a/solenv/gbuild/PythonTest.mk +++ b/solenv/gbuild/PythonTest.mk @@ -52,7 +52,7 @@ else UserInstallation=$(call gb_Helper_make_url,$(dir $(call gb_PythonTest_get_target,$*))user) \ TestUserDir="$(call gb_Helper_make_url,$(dir $(call gb_PythonTest_get_target,$*)))" \ PYTHONDONTWRITEBYTECODE=1 \ - $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(ENABLE_HEADLESS),, \ + $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(DISABLE_GUI),, \ SAL_USE_VCLPLUGIN=svp \ )) \ $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) \ diff --git a/solenv/gbuild/UITest.mk b/solenv/gbuild/UITest.mk index 03d30448ef7b..00579ebdb4e5 100644 --- a/solenv/gbuild/UITest.mk +++ b/solenv/gbuild/UITest.mk @@ -69,7 +69,7 @@ else PYTHONPATH="$(PYPATH)" \ TestUserDir="$(call gb_Helper_make_url,$(dir $(call gb_UITest_get_target,$*)))" \ PYTHONDONTWRITEBYTECODE=0 \ - $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(ENABLE_HEADLESS),, \ + $(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if $(DISABLE_GUI),, \ SAL_USE_VCLPLUGIN=svp \ )) \ $(gb_UITest_COMMAND) \ diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk index 451897fc4765..00d9bc57921a 100644 --- a/solenv/gbuild/extensions/pre_MergedLibsList.mk +++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk @@ -42,7 +42,7 @@ MERGE_LIBRARY_LIST := \ sfx \ sofficeapp \ sot \ - $(if $(ENABLE_HEADLESS),,spl) \ + $(if $(DISABLE_GUI),,spl) \ svl \ svt \ svx \ diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index b87f6fc569dd..a67780a2cef8 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -227,7 +227,7 @@ gb_GLOBALDEFS += -DDEBUG \ endif endif -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) gb_GLOBALDEFS += -DLIBO_HEADLESS \ endif diff --git a/svx/Executable_gengal.mk b/svx/Executable_gengal.mk index 844ab0b45e16..e4c73928711b 100644 --- a/svx/Executable_gengal.mk +++ b/svx/Executable_gengal.mk @@ -61,7 +61,7 @@ $(eval $(call gb_Executable_use_system_win32_libs,gengal,\ )) endif -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_Executable_add_libs,gengal,\ $(DLOPEN_LIBS) \ -lpthread \ diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 601a03beb66a..54b551e5e0b5 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -86,7 +86,7 @@ $(eval $(call gb_Library_use_externals,svxcore,\ libxml2 \ $(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,svxcore,\ epoxy \ )) diff --git a/sw/CppunitTest_sw_mailmerge.mk b/sw/CppunitTest_sw_mailmerge.mk index 3db2df0cf2fd..5f943f74f364 100644 --- a/sw/CppunitTest_sw_mailmerge.mk +++ b/sw/CppunitTest_sw_mailmerge.mk @@ -81,7 +81,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_mailmerge, \ uui/util/uui \ vcl/vcl.common \ $(if $(filter-out MACOSX WNT,$(OS)), \ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ vcl/vcl.unx \ ) \ ) \ diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk index e322445d052f..bf227939f074 100644 --- a/sw/CppunitTest_sw_odfimport.mk +++ b/sw/CppunitTest_sw_odfimport.mk @@ -81,7 +81,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfimport,\ unoxml/source/service/unoxml \ uui/util/uui \ $(if $(filter-out MACOSX WNT,$(OS)), \ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ vcl/vcl.unx \ ) \ ) \ diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index c8338ff481cc..b9127c379424 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -97,7 +97,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_unowriter \ )) -ifneq ($(ENABLE_HEADLESS),TRUE) +ifneq ($(DISABLE_GUI),TRUE) ifeq ($(OS),LINUX) $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_tiledrendering \ diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk index 29dc182bbc4f..2bc1dbdf2d0b 100644 --- a/toolkit/Library_tk.mk +++ b/toolkit/Library_tk.mk @@ -25,7 +25,7 @@ $(eval $(call gb_Library_use_externals,tk,\ boost_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,tk,\ epoxy \ )) diff --git a/vcl/CppunitTest_vcl_bitmap_test.mk b/vcl/CppunitTest_vcl_bitmap_test.mk index 9d2a132d6454..bae00152c77d 100644 --- a/vcl/CppunitTest_vcl_bitmap_test.mk +++ b/vcl/CppunitTest_vcl_bitmap_test.mk @@ -18,7 +18,7 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\ boost_headers \ glm_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\ epoxy \ )) diff --git a/vcl/Executable_icontest.mk b/vcl/Executable_icontest.mk index 8c917b71cd0e..b162800e72fd 100644 --- a/vcl/Executable_icontest.mk +++ b/vcl/Executable_icontest.mk @@ -13,7 +13,7 @@ $(eval $(call gb_Executable_use_externals,icontest,\ boost_headers \ glm_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Executable_use_externals,icontest,\ epoxy \ )) diff --git a/vcl/Executable_vcldemo.mk b/vcl/Executable_vcldemo.mk index c06725c297cf..125a151dec99 100644 --- a/vcl/Executable_vcldemo.mk +++ b/vcl/Executable_vcldemo.mk @@ -20,7 +20,7 @@ $(eval $(call gb_Executable_use_externals,vcldemo,\ glm_headers \ harfbuzz \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Executable_use_externals,vcldemo,\ epoxy \ )) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 95c466d27f20..2f69f6550dae 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -29,7 +29,7 @@ else ifeq ($(OS),ANDROID) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.android)) else ifeq ($(OS),IOS) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.ios)) -else ifeq ($(ENABLE_HEADLESS),TRUE) +else ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.headless)) else $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.unx)) @@ -122,7 +122,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ lcms2 \ mdds_headers \ )) -ifeq ($(ENABLE_HEADLESS),) +ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,vcl,\ epoxy \ )) @@ -613,7 +613,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ )) endif -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 0fc88c18c26f..b8731614797a 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -28,11 +28,11 @@ $(eval $(call gb_Module_add_targets,vcl,\ $(if $(filter DESKTOP,$(BUILD_TYPE)), \ StaticLibrary_vclmain \ $(if $(ENABLE_MACOSX_SANDBOX),, \ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ Executable_ui-previewer)) \ $(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)), \ Executable_outdevgrind \ - $(if $(ENABLE_HEADLESS),, \ + $(if $(DISABLE_GUI),, \ Executable_vcldemo \ Executable_icontest \ Executable_visualbackendtest \ @@ -224,7 +224,7 @@ $(eval $(call gb_Module_add_check_targets,vcl,\ )) endif -ifeq ($(ENABLE_HEADLESS),TRUE) +ifeq ($(DISABLE_GUI),TRUE) $(eval $(call gb_Module_add_check_targets,vcl,\ CppunitTest_vcl_timer \ )) commit e6f4779de8fea16931967ce206439c5780d46125 Author: Noel Grandin <[email protected]> AuthorDate: Fri Aug 24 16:32:42 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Aug 27 08:47:38 2018 +0200 directly use malloc/free in sal, instead of rtl_allocateMemory/etc now that those functions are entirely malloc/free based, we can skip a function call layer. Change-Id: Ib091de0bdf4cdd58cee45185df17d96d3e8af402 Reviewed-on: https://gerrit.libreoffice.org/59576 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index ae221a8834a6..910345d74f28 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -186,7 +186,7 @@ FileHandle_Impl::FileHandle_Impl(int fd, enum Kind kind, char const * path) if (pagesize != size_t(-1)) { m_bufsiz = pagesize; - m_buffer = static_cast<sal_uInt8 *>(rtl_allocateMemory(m_bufsiz)); + m_buffer = static_cast<sal_uInt8 *>(malloc(m_bufsiz)); if (m_buffer) memset(m_buffer, 0, m_bufsiz); } @@ -197,7 +197,7 @@ FileHandle_Impl::~FileHandle_Impl() { if (m_kind == KIND_FD) { - rtl_freeMemory(m_buffer); + free(m_buffer); m_buffer = nullptr; } @@ -208,12 +208,12 @@ FileHandle_Impl::~FileHandle_Impl() void* FileHandle_Impl::operator new (size_t n) { - return rtl_allocateMemory(n); + return malloc(n); } void FileHandle_Impl::operator delete (void * p) { - rtl_freeMemory(p); + free(p); } size_t FileHandle_Impl::getpagesize() diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 74712563311b..873bec3cb988 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -92,11 +92,11 @@ DirectoryItem_Impl::~DirectoryItem_Impl() void * DirectoryItem_Impl::operator new(size_t n) { - return rtl_allocateMemory(n); + return malloc(n); } void DirectoryItem_Impl::operator delete(void * p) { - rtl_freeMemory(p); + free(p); } void DirectoryItem_Impl::acquire() @@ -170,7 +170,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* ustrDirectoryURL, oslDirect if( pdir ) { - oslDirectoryImpl* pDirImpl = (oslDirectoryImpl*) rtl_allocateMemory( sizeof(oslDirectoryImpl) ); + oslDirectoryImpl* pDirImpl = (oslDirectoryImpl*) malloc( sizeof(oslDirectoryImpl) ); if( pDirImpl ) { @@ -197,7 +197,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* ustrDirectoryURL, oslDirect if( pdir ) { /* create and initialize impl structure */ - oslDirectoryImpl* pDirImpl = static_cast<oslDirectoryImpl*>(rtl_allocateMemory( sizeof(oslDirectoryImpl) )); + oslDirectoryImpl* pDirImpl = static_cast<oslDirectoryImpl*>(malloc( sizeof(oslDirectoryImpl) )); if( pDirImpl ) { @@ -251,7 +251,7 @@ oslFileError SAL_CALL osl_closeDirectory(oslDirectory pDirectory) /* cleanup members */ rtl_uString_release(pDirImpl->ustrPath); - rtl_freeMemory(pDirImpl); + free(pDirImpl); return err; } diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index d103c4573d0a..4bd77901b247 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -1068,7 +1068,7 @@ static sal_Char* OslProfile_getLine(osl_TFile* pFile) SAL_INFO("sal.osl", "read failed " << strerror(errno)); if( pLine ) - rtl_freeMemory( pLine ); + free( pLine ); pLine = nullptr; break; } @@ -1088,11 +1088,11 @@ static sal_Char* OslProfile_getLine(osl_TFile* pFile) pChr++); Max = pChr - pFile->m_pReadPtr; - pNewLine = static_cast<sal_Char*>(rtl_allocateMemory( nLineBytes + Max + 1 )); + pNewLine = static_cast<sal_Char*>(malloc( nLineBytes + Max + 1 )); if( pLine ) { memcpy( pNewLine, pLine, nLineBytes ); - rtl_freeMemory( pLine ); + free( pLine ); } memcpy(pNewLine+nLineBytes, pFile->m_pReadPtr, Max); nLineBytes += Max; @@ -1546,7 +1546,7 @@ static bool loadProfile(osl_TFile* pFile, osl_TProfileImpl* pProfile) while ( ( pLine=OslProfile_getLine(pFile) ) != nullptr ) { sal_Char* bWasAdded = addLine( pProfile, pLine ); - rtl_freeMemory( pLine ); + free( pLine ); SAL_WARN_IF(!bWasAdded, "sal.osl", "addLine( pProfile, pLine ) ==> false"); if ( ! bWasAdded ) return false; diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index c941f25658eb..edacf5f5e565 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -345,7 +345,7 @@ static oslSocketAddr createSocketAddrFromSystem( struct sockaddr *pSystemSockAdd static void destroySocketAddr( oslSocketAddr addr ) { - rtl_freeMemory( addr ); + free( addr ); } oslSocketAddr SAL_CALL osl_createEmptySocketAddr(oslAddrFamily Family) diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx index affbc5c3fb9c..1cac41ce717b 100644 --- a/sal/osl/unx/thread.cxx +++ b/sal/osl/unx/thread.cxx @@ -964,7 +964,7 @@ struct wrapper_pthread_key oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallback ) { - wrapper_pthread_key *pKey = static_cast<wrapper_pthread_key*>(rtl_allocateMemory(sizeof(wrapper_pthread_key))); + wrapper_pthread_key *pKey = static_cast<wrapper_pthread_key*>(malloc(sizeof(wrapper_pthread_key))); if (pKey) { @@ -972,7 +972,7 @@ oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallbac if (pthread_key_create(&(pKey->m_key), pKey->pfnCallback) != 0) { - rtl_freeMemory(pKey); + free(pKey); pKey = nullptr; } } @@ -986,7 +986,7 @@ void SAL_CALL osl_destroyThreadKey(oslThreadKey Key) if (pKey) { pthread_key_delete(pKey->m_key); - rtl_freeMemory(pKey); + free(pKey); } } diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index e92c5a584c31..78dfaa046939 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -153,26 +153,26 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile) m_buffer (nullptr) { ::InitializeCriticalSection (&m_mutex); - m_buffer = static_cast<sal_uInt8 *>(rtl_allocateMemory(m_bufsiz)); + m_buffer = static_cast<sal_uInt8 *>(malloc(m_bufsiz)); if (m_buffer) memset (m_buffer, 0, m_bufsiz); } FileHandle_Impl::~FileHandle_Impl() { - rtl_freeMemory(m_buffer); + free(m_buffer); m_buffer = nullptr; ::DeleteCriticalSection (&m_mutex); } void * FileHandle_Impl::operator new(size_t n) { - return rtl_allocateMemory(n); + return malloc(n); } void FileHandle_Impl::operator delete(void * p, size_t) { - rtl_freeMemory(p); + free(p); } SIZE_T FileHandle_Impl::getpagesize() diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index ef0f78491331..268c32a75dda 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -344,7 +344,7 @@ static HANDLE WINAPI OpenDirectory( rtl_uString* pPath) nSuffLen = 3; } - WCHAR* szFileMask = static_cast< WCHAR* >( rtl_allocateMemory( sizeof( WCHAR ) * ( nLen + nSuffLen + 1 ) ) ); + WCHAR* szFileMask = static_cast< WCHAR* >( malloc( sizeof( WCHAR ) * ( nLen + nSuffLen + 1 ) ) ); wcscpy( szFileMask, o3tl::toW(rtl_uString_getStr( pPath )) ); wcscat( szFileMask, pSuffix ); @@ -360,7 +360,7 @@ static HANDLE WINAPI OpenDirectory( rtl_uString* pPath) pDirectory = nullptr; } } - rtl_freeMemory(szFileMask); + free(szFileMask); } } @@ -436,7 +436,7 @@ static oslFileError osl_openLocalRoot( { Directory_Impl *pDirImpl; - pDirImpl = static_cast<Directory_Impl*>(rtl_allocateMemory( sizeof(Directory_Impl))); + pDirImpl = static_cast<Directory_Impl*>(malloc( sizeof(Directory_Impl))); ZeroMemory( pDirImpl, sizeof(Directory_Impl) ); rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strSysPath ); @@ -479,7 +479,7 @@ static oslFileError osl_openLocalRoot( pDirImpl->m_pDirectoryPath = nullptr; } - rtl_freeMemory(pDirImpl); + free(pDirImpl); pDirImpl = nullptr; } @@ -500,7 +500,7 @@ static oslFileError osl_openFileDirectory( return osl_File_E_INVAL; *pDirectory = nullptr; - Directory_Impl *pDirImpl = static_cast<Directory_Impl*>(rtl_allocateMemory(sizeof(Directory_Impl))); + Directory_Impl *pDirImpl = static_cast<Directory_Impl*>(malloc(sizeof(Directory_Impl))); ZeroMemory( pDirImpl, sizeof(Directory_Impl) ); rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strDirectoryPath ); @@ -535,7 +535,7 @@ static oslFileError osl_openFileDirectory( pDirImpl->m_pDirectoryPath = nullptr; } - rtl_freeMemory(pDirImpl); + free(pDirImpl); pDirImpl = nullptr; } @@ -565,7 +565,7 @@ static oslFileError osl_openNetworkServer( { Directory_Impl *pDirImpl; - pDirImpl = static_cast<Directory_Impl*>(rtl_allocateMemory(sizeof(Directory_Impl))); + pDirImpl = static_cast<Directory_Impl*>(malloc(sizeof(Directory_Impl))); ZeroMemory( pDirImpl, sizeof(Directory_Impl) ); pDirImpl->uType = DIRECTORYTYPE_NETROOT; pDirImpl->hDirectory = hEnum; @@ -783,7 +783,7 @@ static oslFileError osl_getNextNetResource( case NO_ERROR: case ERROR_MORE_DATA: { - pItemImpl = static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + pItemImpl = static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) return osl_File_E_NOMEM; @@ -817,7 +817,7 @@ static oslFileError osl_getNextDrive( if ( !pDirImpl ) return osl_File_E_INVAL; - pItemImpl = static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + pItemImpl = static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) return osl_File_E_NOMEM; @@ -839,7 +839,7 @@ static oslFileError osl_getNextDrive( pItemImpl->m_pFullPath = nullptr; } - rtl_freeMemory( pItemImpl ); + free( pItemImpl ); return oslTranslateFileError( GetLastError() ); } } @@ -858,7 +858,7 @@ static oslFileError osl_getNextFileItem( if ( !pDirImpl ) return osl_File_E_INVAL; - pItemImpl = static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + pItemImpl = static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) return osl_File_E_NOMEM; @@ -887,7 +887,7 @@ static oslFileError osl_getNextFileItem( pItemImpl->m_pFullPath = nullptr; } - rtl_freeMemory( pItemImpl ); + free( pItemImpl ); return oslTranslateFileError( GetLastError() ); } } @@ -951,7 +951,7 @@ oslFileError SAL_CALL osl_closeDirectory(oslDirectory Directory) pDirImpl->m_pDirectoryPath = nullptr; } - rtl_freeMemory(pDirImpl); + free(pDirImpl); } return eError; } @@ -999,7 +999,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector case PATHTYPE_NETSERVER: { DirectoryItem_Impl* pItemImpl = - static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) error = osl_File_E_NOMEM; @@ -1030,7 +1030,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector case PATHTYPE_VOLUME: { DirectoryItem_Impl* pItemImpl = - static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) error = osl_File_E_NOMEM; @@ -1067,7 +1067,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector if ( hFind != INVALID_HANDLE_VALUE ) { DirectoryItem_Impl *pItemImpl = - static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); ZeroMemory( pItemImpl, sizeof(DirectoryItem_Impl) ); osl_acquireDirectoryItem( static_cast<oslDirectoryItem>(pItemImpl) ); @@ -1120,7 +1120,7 @@ oslFileError SAL_CALL osl_releaseDirectoryItem( oslDirectoryItem Item ) pItemImpl->m_pFullPath = nullptr; } - rtl_freeMemory( pItemImpl ); + free( pItemImpl ); } return osl_File_E_None; diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 6cdb140aa22d..82260c85ef07 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -493,7 +493,7 @@ static bool osl_decodeURL_( rtl_String* strUTF8, rtl_uString** pstrDecodedURL ) /* The resulting decoded string length is shorter or equal to the source length */ nSrcLen = rtl_string_getLength(strUTF8); - pBuffer = static_cast<sal_Char*>(rtl_allocateMemory((nSrcLen + 1) * sizeof(sal_Char))); + pBuffer = static_cast<sal_Char*>(malloc((nSrcLen + 1) * sizeof(sal_Char))); pDest = pBuffer; pSrc = rtl_string_getStr(strUTF8); @@ -543,7 +543,7 @@ static bool osl_decodeURL_( rtl_String* strUTF8, rtl_uString** pstrDecodedURL ) OSL_ASSERT(*pstrDecodedURL != nullptr); } - rtl_freeMemory( pBuffer ); + free( pBuffer ); return bValidEncoded; } @@ -561,7 +561,7 @@ static void osl_encodeURL_( rtl_uString *strURL, rtl_String **pstrEncodedURL ) rtl_uString2String( &strUTF8, rtl_uString_getStr( strURL ), rtl_uString_getLength( strURL ), RTL_TEXTENCODING_UTF8, OUSTRING_TO_OSTRING_CVTFLAGS ); - pszEncodedURL = static_cast<sal_Char*>(rtl_allocateMemory( (rtl_string_getLength( strUTF8 ) * 3 + 1) * sizeof(sal_Char) )); + pszEncodedURL = static_cast<sal_Char*>(malloc( (rtl_string_getLength( strUTF8 ) * 3 + 1) * sizeof(sal_Char) )); pURLDest = pszEncodedURL; pURLScan = rtl_string_getStr( strUTF8 ); @@ -614,7 +614,7 @@ static void osl_encodeURL_( rtl_uString *strURL, rtl_String **pstrEncodedURL ) rtl_string_release( strUTF8 ); rtl_string_newFromStr( pstrEncodedURL, pszEncodedURL ); - rtl_freeMemory( pszEncodedURL ); + free( pszEncodedURL ); } oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **pustrPath, bool bAllowRelative ) @@ -903,8 +903,8 @@ oslFileError SAL_CALL osl_searchFileURL( /* +1 is not necessary if we follow MSDN documentation but for robustness we do so */ nBufferLength = dwResult + 1; lpBuffer = lpBuffer ? - static_cast<LPWSTR>(rtl_reallocateMemory(lpBuffer, nBufferLength * sizeof(WCHAR))) : - static_cast<LPWSTR>(rtl_allocateMemory(nBufferLength * sizeof(WCHAR))); + static_cast<LPWSTR>(realloc(lpBuffer, nBufferLength * sizeof(WCHAR))) : + static_cast<LPWSTR>(malloc(nBufferLength * sizeof(WCHAR))); dwResult = SearchPathW( lpszSearchPath, lpszSearchFile, nullptr, nBufferLength, lpBuffer, &lpszFilePart ); } while ( dwResult && dwResult >= nBufferLength ); @@ -934,7 +934,7 @@ oslFileError SAL_CALL osl_searchFileURL( } } - rtl_freeMemory( lpBuffer ); + free( lpBuffer ); } if ( ustrSysPath ) diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx index 0210791f401f..237c130f7fd8 100644 --- a/sal/osl/w32/path_helper.hxx +++ b/sal/osl/w32/path_helper.hxx @@ -93,7 +93,7 @@ class LongPathBuffer public: explicit LongPathBuffer( sal_uInt32 nCharNum ) - : m_pBuffer( static_cast<T*>( rtl_allocateMemory( nCharNum * sizeof( T ) ) ) ) + : m_pBuffer( static_cast<T*>( malloc( nCharNum * sizeof( T ) ) ) ) , m_nCharNum( nCharNum ) { OSL_ENSURE( m_pBuffer, "Can not allocate the buffer!" ); @@ -102,7 +102,7 @@ public: ~LongPathBuffer() { if ( m_pBuffer ) - rtl_freeMemory( m_pBuffer ); + free( m_pBuffer ); m_pBuffer = nullptr; } diff --git a/sal/osl/w32/pipe.cxx b/sal/osl/w32/pipe.cxx index 116bdd3d6817..92ec4f918354 100644 --- a/sal/osl/w32/pipe.cxx +++ b/sal/osl/w32/pipe.cxx @@ -87,8 +87,8 @@ void osl_destroyPipeImpl(oslPipe pPipe) if (pPipe->m_Security) { - rtl_freeMemory(pPipe->m_Security->lpSecurityDescriptor); - rtl_freeMemory(pPipe->m_Security); + free(pPipe->m_Security->lpSecurityDescriptor); + free(pPipe->m_Security); } CloseHandle(pPipe->m_ReadEvent); @@ -98,7 +98,7 @@ void osl_destroyPipeImpl(oslPipe pPipe) if (pPipe->m_Name) rtl_uString_release(pPipe->m_Name); - rtl_freeMemory(pPipe); + free(pPipe); } } @@ -135,13 +135,13 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options { PSECURITY_DESCRIPTOR pSecDesc; - pSecDesc = static_cast< PSECURITY_DESCRIPTOR >(rtl_allocateMemory(SECURITY_DESCRIPTOR_MIN_LENGTH)); + pSecDesc = static_cast< PSECURITY_DESCRIPTOR >(malloc(SECURITY_DESCRIPTOR_MIN_LENGTH)); /* add a NULL disc. ACL to the security descriptor */ OSL_VERIFY(InitializeSecurityDescriptor(pSecDesc, SECURITY_DESCRIPTOR_REVISION)); OSL_VERIFY(SetSecurityDescriptorDacl(pSecDesc, TRUE, nullptr, FALSE)); - pSecAttr = static_cast< PSECURITY_ATTRIBUTES >(rtl_allocateMemory(sizeof(SECURITY_ATTRIBUTES))); + pSecAttr = static_cast< PSECURITY_ATTRIBUTES >(malloc(sizeof(SECURITY_ATTRIBUTES))); pSecAttr->nLength = sizeof(SECURITY_ATTRIBUTES); pSecAttr->lpSecurityDescriptor = pSecDesc; pSecAttr->bInheritHandle = TRUE; diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 92d61b93ada9..f1e223bd34cd 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -147,7 +147,7 @@ oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident) if (hProcess) { - pProcImpl = static_cast< oslProcessImpl*>( rtl_allocateMemory(sizeof(oslProcessImpl)) ); + pProcImpl = static_cast< oslProcessImpl*>( malloc(sizeof(oslProcessImpl)) ); pProcImpl->m_hProcess = hProcess; pProcImpl->m_IdProcess = Ident; } @@ -163,7 +163,7 @@ void SAL_CALL osl_freeProcessHandle(oslProcess Process) { CloseHandle(static_cast<oslProcessImpl*>(Process)->m_hProcess); - rtl_freeMemory(Process); + free(Process); } } diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index b65a942cb9d4..a2e4021f0f1f 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -546,7 +546,7 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO( CloseHandle(process_info.hThread); oslProcessImpl* pProcImpl = static_cast<oslProcessImpl*>( - rtl_allocateMemory(sizeof(oslProcessImpl))); + malloc(sizeof(oslProcessImpl))); if (pProcImpl != nullptr) { diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx index 6d9be8dd2930..e25e35cbdc24 100644 --- a/sal/osl/w32/socket.cxx +++ b/sal/osl/w32/socket.cxx @@ -236,7 +236,7 @@ void destroySocketImpl(oslSocketImpl *pImpl) { if (pImpl) { - rtl_freeMemory (pImpl); + free (pImpl); } } @@ -285,7 +285,7 @@ static void destroySocketAddr( oslSocketAddr addr ) #if OSL_DEBUG_LEVEL > 0 g_nSocketAddr --; #endif - rtl_freeMemory( addr ); + free( addr ); } oslSocketAddr SAL_CALL osl_createEmptySocketAddr(oslAddrFamily Family) @@ -475,7 +475,7 @@ oslHostAddr SAL_CALL osl_createHostAddr ( return nullptr; } - pAddr= static_cast<oslHostAddr>(rtl_allocateMemory (sizeof (struct oslHostAddrImpl))); + pAddr= static_cast<oslHostAddr>(malloc (sizeof (struct oslHostAddrImpl))); if (pAddr == nullptr) { @@ -595,7 +595,7 @@ void SAL_CALL osl_destroyHostAddr(oslHostAddr pAddr) if (pAddr->pSockAddr) osl_destroySocketAddr( pAddr->pSockAddr ); - rtl_freeMemory (pAddr); + free (pAddr); } } @@ -1623,7 +1623,7 @@ oslSocketSet SAL_CALL osl_createSocketSet() { oslSocketSetImpl* pSet; - pSet = static_cast<oslSocketSetImpl*>(rtl_allocateMemory(sizeof(oslSocketSetImpl))); + pSet = static_cast<oslSocketSetImpl*>(malloc(sizeof(oslSocketSetImpl))); if(pSet) { @@ -1636,7 +1636,7 @@ oslSocketSet SAL_CALL osl_createSocketSet() void SAL_CALL osl_destroySocketSet (oslSocketSet Set) { if(Set) - rtl_freeMemory(Set); + free(Set); } void SAL_CALL osl_clearSocketSet (oslSocketSet Set) diff --git a/sal/osl/w32/thread.cxx b/sal/osl/w32/thread.cxx index 716e299f2a50..a0f46b7e5229 100644 --- a/sal/osl/w32/thread.cxx +++ b/sal/osl/w32/thread.cxx @@ -448,14 +448,14 @@ void osl_callThreadKeyCallbackOnThreadDetach(void) oslThreadKey SAL_CALL osl_createThreadKey(oslThreadKeyCallbackFunction pCallback) { - PTLS pTls = static_cast<PTLS>(rtl_allocateMemory( sizeof(TLS) )); + PTLS pTls = static_cast<PTLS>(malloc( sizeof(TLS) )); if ( pTls ) { pTls->pfnCallback = pCallback; if ( DWORD(-1) == (pTls->dwIndex = TlsAlloc()) ) { - rtl_freeMemory( pTls ); + free( pTls ); pTls = nullptr; } else @@ -473,7 +473,7 @@ void SAL_CALL osl_destroyThreadKey(oslThreadKey Key) RemoveKeyFromList( pTls ); TlsFree( pTls->dwIndex ); - rtl_freeMemory( pTls ); + free( pTls ); } } diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index a802da6a562c..ac735caf713b 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -320,9 +320,9 @@ struct Bootstrap_Impl ~Bootstrap_Impl(); static void * operator new (std::size_t n) - { return rtl_allocateMemory (sal_uInt32(n)); } + { return malloc (sal_uInt32(n)); } static void operator delete (void * p , std::size_t) - { rtl_freeMemory (p); } + { free (p); } bool getValue( rtl::OUString const & key, rtl_uString ** value, diff --git a/sal/rtl/byteseq.cxx b/sal/rtl/byteseq.cxx index d0c77b5dc1ed..64f815b4d73b 100644 --- a/sal/rtl/byteseq.cxx +++ b/sal/rtl/byteseq.cxx @@ -19,12 +19,12 @@ #include <assert.h> #include <string.h> +#include <stdlib.h> #include <osl/diagnose.h> #include <osl/interlck.h> #include <rtl/byteseq.h> -#include <rtl/alloc.h> /* static data to be referenced by all empty strings * the refCount is predefined to 1 and must never become 0 ! @@ -50,17 +50,17 @@ void SAL_CALL rtl_byte_sequence_reference2One( nElements = pSequence->nElements; if (nElements) { - pNew = static_cast<sal_Sequence *>(rtl_allocateMemory( SAL_SEQUENCE_HEADER_SIZE + nElements )); + pNew = static_cast<sal_Sequence *>(malloc( SAL_SEQUENCE_HEADER_SIZE + nElements )); if ( pNew != nullptr ) memcpy( pNew->elements, pSequence->elements, nElements ); if (! osl_atomic_decrement( &pSequence->nRefCount )) - rtl_freeMemory( pSequence ); + free( pSequence ); } else { - pNew = static_cast<sal_Sequence *>(rtl_allocateMemory( SAL_SEQUENCE_HEADER_SIZE )); + pNew = static_cast<sal_Sequence *>(malloc( SAL_SEQUENCE_HEADER_SIZE )); } if ( pNew != nullptr ) @@ -88,7 +88,7 @@ void SAL_CALL rtl_byte_sequence_realloc( if (pSequence->nRefCount > 1) // split { - pNew = static_cast<sal_Sequence *>(rtl_allocateMemory( SAL_SEQUENCE_HEADER_SIZE + nSize )); + pNew = static_cast<sal_Sequence *>(malloc( SAL_SEQUENCE_HEADER_SIZE + nSize )); if ( pNew != nullptr ) { @@ -104,12 +104,12 @@ void SAL_CALL rtl_byte_sequence_realloc( } if (! osl_atomic_decrement( &pSequence->nRefCount )) - rtl_freeMemory( pSequence ); + free( pSequence ); pSequence = pNew; } else { - pSequence = static_cast<sal_Sequence *>(rtl_reallocateMemory( + pSequence = static_cast<sal_Sequence *>(realloc( pSequence, SAL_SEQUENCE_HEADER_SIZE + nSize )); } @@ -136,7 +136,7 @@ void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence ) { if (! osl_atomic_decrement( &(pSequence->nRefCount )) ) { - rtl_freeMemory( pSequence ); + free( pSequence ); } } } @@ -178,7 +178,7 @@ void SAL_CALL rtl_byte_sequence_constructNoDefault( sal_Sequence **ppSequence , *ppSequence = nullptr; } - *ppSequence = static_cast<sal_Sequence *>(rtl_allocateMemory( SAL_SEQUENCE_HEADER_SIZE + nLength )); + *ppSequence = static_cast<sal_Sequence *>(malloc( SAL_SEQUENCE_HEADER_SIZE + nLength )); if ( *ppSequence != nullptr ) { diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx index 96cb896623e1..3041d865b7b0 100644 --- a/sal/rtl/cipher.cxx +++ b/sal/rtl/cipher.cxx @@ -1138,7 +1138,7 @@ void SAL_CALL rtl_cipher_destroyBF(rtlCipher Cipher) SAL_THROW_EXTERN_C() rtl_freeZeroMemory(pImpl, sizeof(CipherBF_Impl)); } else - rtl_freeMemory(pImpl); + free(pImpl); } } @@ -1409,7 +1409,7 @@ void SAL_CALL rtl_cipher_destroyARCFOUR(rtlCipher Cipher) SAL_THROW_EXTERN_C() rtl_freeZeroMemory(pImpl, sizeof(CipherARCFOUR_Impl)); } else - rtl_freeMemory(pImpl); + free(pImpl); } } diff --git a/sal/rtl/cmdargs.cxx b/sal/rtl/cmdargs.cxx index 8e10b0bca04d..3c3069f4fd6a 100644 --- a/sal/rtl/cmdargs.cxx +++ b/sal/rtl/cmdargs.cxx @@ -37,7 +37,7 @@ ArgHolder::~ArgHolder() while (g_nCommandArgCount > 0) rtl_uString_release (g_ppCommandArgs[--g_nCommandArgCount]); - rtl_freeMemory (g_ppCommandArgs); + free (g_ppCommandArgs); g_ppCommandArgs = nullptr; } diff --git a/sal/rtl/digest.cxx b/sal/rtl/digest.cxx index fbacbc9838dd..3bd2dfa214dd 100644 --- a/sal/rtl/digest.cxx +++ b/sal/rtl/digest.cxx @@ -18,6 +18,7 @@ */ #include <string.h> +#include <stdlib.h> #include <sal/types.h> #include <osl/endian.h> @@ -430,7 +431,7 @@ void SAL_CALL rtl_digest_destroyMD2(rtlDigest Digest) SAL_THROW_EXTERN_C() if (pImpl->m_digest.m_algorithm == rtl_Digest_AlgorithmMD2) rtl_freeZeroMemory(pImpl, sizeof(DigestMD2_Impl)); else - rtl_freeMemory(pImpl); + free(pImpl); } } @@ -813,7 +814,7 @@ void SAL_CALL rtl_digest_destroyMD5(rtlDigest Digest) SAL_THROW_EXTERN_C() if (pImpl->m_digest.m_algorithm == rtl_Digest_AlgorithmMD5) rtl_freeZeroMemory(pImpl, sizeof(DigestMD5_Impl)); else - rtl_freeMemory(pImpl); + free(pImpl); } } @@ -1227,7 +1228,7 @@ void SAL_CALL rtl_digest_destroySHA(rtlDigest Digest) SAL_THROW_EXTERN_C() if (pImpl->m_digest.m_algorithm == rtl_Digest_AlgorithmSHA) rtl_freeZeroMemory(pImpl, sizeof(DigestSHA_Impl)); else - rtl_freeMemory(pImpl); + free(pImpl); } } @@ -1387,7 +1388,7 @@ void SAL_CALL rtl_digest_destroySHA1(rtlDigest Digest) SAL_THROW_EXTERN_C() if (pImpl->m_digest.m_algorithm == rtl_Digest_AlgorithmSHA1) rtl_freeZeroMemory(pImpl, sizeof(DigestSHA_Impl)); else - rtl_freeMemory(pImpl); + free(pImpl); } } @@ -1584,7 +1585,7 @@ void SAL_CALL rtl_digest_destroyHMAC_MD5(rtlDigest Digest) SAL_THROW_EXTERN_C() if (pImpl->m_digest.m_algorithm == rtl_Digest_AlgorithmHMAC_MD5) rtl_freeZeroMemory(pImpl, sizeof(DigestHMAC_MD5_Impl)); else - rtl_freeMemory(pImpl); + free(pImpl); } } @@ -1781,7 +1782,7 @@ void SAL_CALL rtl_digest_destroyHMAC_SHA1(rtlDigest Digest) if (pImpl->m_digest.m_algorithm == rtl_Digest_AlgorithmHMAC_SHA1) rtl_freeZeroMemory(pImpl, sizeof(DigestHMAC_SHA1_Impl)); else - rtl_freeMemory(pImpl); + free(pImpl); } } diff --git a/sal/rtl/locale.cxx b/sal/rtl/locale.cxx index b6b5ee499141..3fb85e1b8bb7 100644 --- a/sal/rtl/locale.cxx +++ b/sal/rtl/locale.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <stdlib.h> #include <rtl/locale.h> #include <osl/diagnose.h> -#include <rtl/alloc.h> #include <rtllifecycle.h> @@ -56,8 +56,8 @@ extern "C" void rtl_hashentry_destroy(RTL_HASHENTRY* entry) if (entry->Next) rtl_hashentry_destroy(entry->Next); - rtl_freeMemory(entry->Entry); - rtl_freeMemory(entry); + free(entry->Entry); + free(entry); } extern "C" void rtl_hashtable_destroy(RTL_HASHTABLE* table) @@ -77,8 +77,8 @@ extern "C" void rtl_hashtable_destroy(RTL_HASHTABLE* table) size--; } - rtl_freeMemory(table->Table); - rtl_freeMemory(table); + free(table->Table); + free(table); } extern "C" void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) @@ -88,12 +88,12 @@ extern "C" void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) if (*table) rtl_hashtable_destroy(*table); - *table = static_cast< RTL_HASHTABLE* >(rtl_allocateMemory(sizeof(RTL_HASHTABLE))); + *table = static_cast< RTL_HASHTABLE* >(malloc(sizeof(RTL_HASHTABLE))); (*table)->iSize = sizeIndex; (*table)->Size = nSize; (*table)->Elements = 0; - (*table)->Table = static_cast< RTL_HASHENTRY** >(rtl_allocateMemory((*table)->Size * sizeof(RTL_HASHENTRY*))); + (*table)->Table = static_cast< RTL_HASHENTRY** >(malloc((*table)->Size * sizeof(RTL_HASHENTRY*))); while (nSize) { @@ -130,7 +130,7 @@ extern "C" rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* valu pEntry = &(*pEntry)->Next; } - RTL_HASHENTRY *newEntry = static_cast< RTL_HASHENTRY* >(rtl_allocateMemory(sizeof(RTL_HASHENTRY))); + RTL_HASHENTRY *newEntry = static_cast< RTL_HASHENTRY* >(malloc(sizeof(RTL_HASHENTRY))); newEntry->Entry = value; newEntry->Next = nullptr; *pEntry = newEntry; @@ -158,18 +158,18 @@ sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table) { rtl_hashtable_add(&pNewTable, pEntry->Next->Entry); pNext = pEntry->Next; - rtl_freeMemory(pEntry); + free(pEntry); pEntry = pNext; } - rtl_freeMemory(pEntry); + free(pEntry); } i++; } - rtl_freeMemory((*table)->Table); - rtl_freeMemory(*table); + free((*table)->Table); + free(*table); (*table) = pNewTable; return true; @@ -247,7 +247,7 @@ rtl_Locale * SAL_CALL rtl_locale_register(const sal_Unicode * language, const sa rtl_uString_newFromStr(&sCountry, country); rtl_uString_newFromStr(&sVariant, variant); - newLocale = static_cast<rtl_Locale*>(rtl_allocateMemory( sizeof(rtl_Locale) )); + newLocale = static_cast<rtl_Locale*>(malloc( sizeof(rtl_Locale) )); newLocale->Language = sLanguage; newLocale->Country = sCountry; diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index 7b172f1ee1d2..12571baf4b86 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -464,7 +464,7 @@ inline void doubleToString(typename T::String ** pResult, if (nBuf > nBufMax) { pBuf = static_cast< typename T::Char * >( - rtl_allocateMemory(nBuf * sizeof (typename T::Char))); + malloc(nBuf * sizeof (typename T::Char))); OSL_ENSURE(pBuf, "Out of memory"); } else @@ -707,7 +707,7 @@ inline void doubleToString(typename T::String ** pResult, T::appendChars(pResult, pResultCapacity, &nResultOffset, pBuf, p - pBuf); if (pBuf != &aBuf[0]) - rtl_freeMemory(pBuf); + free(pBuf); } } diff --git a/sal/rtl/strimp.cxx b/sal/rtl/strimp.cxx index d1651a2ad1d7..51a1a94bd705 100644 --- a/sal/rtl/strimp.cxx +++ b/sal/rtl/strimp.cxx @@ -65,11 +65,11 @@ bool rtl_ImplIsWhitespace( sal_Unicode c ) */ static rtl_arena_type *pre_arena = nullptr; -rtl_allocateStringFn rtl_allocateString = rtl_allocateMemory; -rtl_freeStringFn rtl_freeString = rtl_freeMemory; +rtl_allocateStringFn rtl_allocateString = malloc; +rtl_freeStringFn rtl_freeString = free; extern "C" { -static void *pre_allocateStringFn(sal_Size n) +static void *pre_allocateStringFn(size_t n) { sal_Size size = RTL_MEMORY_ALIGN(n + 4, 4); char *addr = static_cast<char*>(rtl_arena_alloc(pre_arena, &size)); @@ -110,8 +110,8 @@ void SAL_CALL rtl_alloc_preInit (sal_Bool start) SAL_THROW_EXTERN_C() else { rtl_arena_foreach(pre_arena, mark_static); - rtl_allocateString = rtl_allocateMemory; - rtl_freeString = rtl_freeMemory; + rtl_allocateString = malloc; + rtl_freeString = free; // TODO: also re-initialize main allocator as well. } diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx index b3446db1fdb2..f3516f7999bd 100644 --- a/sal/rtl/strimp.hxx +++ b/sal/rtl/strimp.hxx @@ -56,7 +56,7 @@ rtl_String* rtl_string_ImplAlloc( sal_Int32 nLen ); extern "C" { -typedef void *(*rtl_allocateStringFn)(sal_Size size); +typedef void *(SAL_CALL * rtl_allocateStringFn)(size_t size); typedef void (*rtl_freeStringFn)(void *); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
