mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-27 14:25:34 +00:00
Fixed libintl conflicts causing compilation errors in Windows.
This commit is contained in:
@@ -12,9 +12,9 @@ Copyright:
|
||||
#ifndef APP_BUILDER_WIDGET_H
|
||||
#define APP_BUILDER_WIDGET_H
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <string>
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "hz/debug.h"
|
||||
#include "hz/instance_manager.h"
|
||||
|
||||
@@ -9,11 +9,8 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm.h>
|
||||
#include <glib.h>
|
||||
#include <cstring> // std::strlen
|
||||
#include <vector>
|
||||
|
||||
@@ -12,7 +12,7 @@ Copyright:
|
||||
#ifndef CLI_EXECUTORS_H
|
||||
#define CLI_EXECUTORS_H
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include "cmdex.h"
|
||||
#include "cmdex_sync.h"
|
||||
|
||||
@@ -9,8 +9,8 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <glib.h> // g_usleep()
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "cmdex_sync.h"
|
||||
|
||||
|
||||
@@ -9,12 +9,9 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h> // Gtk::Main
|
||||
#include <gdkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "hz/string_algo.h"
|
||||
#include "hz/fs_ns.h"
|
||||
|
||||
@@ -9,14 +9,10 @@ Copyright:
|
||||
/// \weakgroup applib_examples
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include <bits/stdc++.h> // to avoid throw() macro errors.
|
||||
#define throw(a) // glibmm uses dynamic exception specifications, remove them.
|
||||
#include <glibmm.h> // NOT NEEDED
|
||||
#undef throw
|
||||
|
||||
#include <iostream>
|
||||
#include "local_glibmm.h"
|
||||
#include <gtkmm.h>
|
||||
#include <bits/stdc++.h> // to avoid throw() macro errors.
|
||||
#include <iostream>
|
||||
|
||||
// #include "applib/smartctl_executor_gui.h"
|
||||
#include "applib/smartctl_executor.h"
|
||||
|
||||
@@ -9,10 +9,10 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <algorithm> // std::max, std::min
|
||||
#include <cmath> // std::floor
|
||||
#include <chrono>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "app_pcrecpp.h"
|
||||
#include "storage_property.h"
|
||||
|
||||
@@ -12,10 +12,7 @@ Copyright:
|
||||
#ifndef SELFTEST_H
|
||||
#define SELFTEST_H
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <glibmm.h> // Timer
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <chrono>
|
||||
|
||||
@@ -9,11 +9,7 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <glibmm.h> // Glib::shell_quote()
|
||||
#include <glibmm/i18n.h>
|
||||
#include "local_glibmm.h" // Glib::shell_quote()
|
||||
|
||||
#include "smartctl_executor.h"
|
||||
#include "hz/win32_tools.h"
|
||||
|
||||
@@ -12,8 +12,8 @@ Copyright:
|
||||
#ifndef SMARTCTL_EXECUTOR_H
|
||||
#define SMARTCTL_EXECUTOR_H
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <vector>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "cmdex.h"
|
||||
#include "cmdex_sync.h"
|
||||
|
||||
@@ -9,13 +9,9 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <clocale> // localeconv
|
||||
#include <cstdint>
|
||||
#include <glibmm.h> // compose()
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "hz/locale_tools.h" // ScopedCLocale, locale_c_get().
|
||||
#include "hz/string_algo.h" // string_*
|
||||
|
||||
@@ -9,11 +9,8 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h> // compose()
|
||||
#include <glibmm/i18n.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "build_config.h" // CONFIG_*
|
||||
|
||||
@@ -15,11 +15,7 @@ Copyright:
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <glibmm.h> // Glib::shell_quote(), compose
|
||||
#include <glibmm/i18n.h>
|
||||
#include "local_glibmm.h" // Glib::shell_quote(), compose
|
||||
|
||||
#include "build_config.h"
|
||||
#include "executor_factory.h"
|
||||
|
||||
@@ -13,7 +13,7 @@ Copyright:
|
||||
|
||||
#if defined CONFIG_KERNEL_LINUX
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
#include "local_glibmm.h"
|
||||
#include <algorithm> // std::find
|
||||
#include <cstdio> // std::fgets(), std::FILE
|
||||
#include <cerrno> // ENXIO
|
||||
|
||||
@@ -13,8 +13,7 @@ Copyright:
|
||||
|
||||
#if !defined CONFIG_KERNEL_LINUX && !defined CONFIG_KERNEL_FAMILY_WINDOWS
|
||||
|
||||
#include <glibmm.h> // compose
|
||||
#include <glibmm/i18n.h>
|
||||
#include "local_glibmm.h"
|
||||
#include <algorithm> // std::sort
|
||||
|
||||
#if defined CONFIG_KERNEL_OPENBSD || defined CONFIG_KERNEL_NETBSD
|
||||
|
||||
@@ -13,10 +13,8 @@ Copyright:
|
||||
|
||||
#if defined CONFIG_KERNEL_FAMILY_WINDOWS
|
||||
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <windows.h> // CreateFileA(), CloseHandle(), etc...
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <set>
|
||||
#include <bitset>
|
||||
#include <map>
|
||||
@@ -27,7 +25,7 @@ Copyright:
|
||||
#include "hz/string_sprintf.h"
|
||||
#include "hz/fs.h"
|
||||
#include "hz/string_num.h"
|
||||
#include "rconfig/config.h"
|
||||
#include "rconfig/rconfig.h"
|
||||
#include "app_pcrecpp.h"
|
||||
#include "storage_detector_win32.h"
|
||||
#include "storage_detector_helpers.h"
|
||||
@@ -541,7 +539,7 @@ inline std::string detect_drives_win32_areca(std::vector<StorageDevicePtr>& driv
|
||||
use_cli = cli_found;
|
||||
}
|
||||
|
||||
std::string cli_binary;
|
||||
hz::fs::path cli_binary;
|
||||
if (use_cli == 1) {
|
||||
cli_binary = hz::fs::u8path(rconfig::get_data<std::string>("system/areca_cli_binary"));
|
||||
if (!cli_binary.is_absolute() && !cli_inst_path.empty()) {
|
||||
@@ -578,7 +576,8 @@ inline std::string detect_drives_win32_areca(std::vector<StorageDevicePtr>& driv
|
||||
debug_out_info("app", "Scanning Areca drives using CLI...\n");
|
||||
int cli_max_controllers = 1; // TODO controller # with CLI.
|
||||
for (int controller_no = 0; controller_no < cli_max_controllers; ++controller_no) {
|
||||
std::string error_msg = areca_cli_get_drives(cli_binary, "/dev/arcmsr" + hz::number_to_string_nolocale(controller_no), controller_no, drives, ex_factory);
|
||||
std::string error_msg = areca_cli_get_drives(cli_binary.string(),
|
||||
"/dev/arcmsr" + hz::number_to_string_nolocale(controller_no), controller_no, drives, ex_factory);
|
||||
// If we get an error on controller 0, fall back to no-cli detection.
|
||||
if (!error_msg.empty() && controller_no == 0) {
|
||||
use_cli = 0;
|
||||
|
||||
@@ -9,9 +9,8 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <unordered_map>
|
||||
#include <glibmm.h> // compose()
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "rconfig/rconfig.h"
|
||||
#include "hz/string_algo.h" // string_trim_copy, string_any_to_unix_copy
|
||||
|
||||
@@ -9,16 +9,12 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <map>
|
||||
#include <ostream> // not iosfwd - it doesn't work
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <locale>
|
||||
#include <glibmm.h> // compose
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "hz/string_num.h" // number_to_string
|
||||
#include "hz/stream_cast.h" // stream_cast<>
|
||||
|
||||
@@ -12,12 +12,8 @@ Copyright:
|
||||
#ifndef STORAGE_PROPERTY_COLORS_H
|
||||
#define STORAGE_PROPERTY_COLORS_H
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <glibmm.h> // compose()
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "storage_property.h"
|
||||
|
||||
|
||||
|
||||
@@ -9,15 +9,11 @@ Copyright:
|
||||
/// \weakgroup applib
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "hz/string_algo.h" // string_replace_copy
|
||||
#include "applib/app_pcrecpp.h"
|
||||
|
||||
@@ -9,11 +9,7 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -9,11 +9,8 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "gsc_executor_log_window.h"
|
||||
#include "gsc_executor_error_dialog.h"
|
||||
|
||||
@@ -9,14 +9,11 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <sstream>
|
||||
#include <cstddef> // std::size_t
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <memory>
|
||||
|
||||
#include "applib/app_gtkmm_utils.h" // app_gtkmm_create_tree_view_column
|
||||
|
||||
@@ -9,11 +9,8 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <vector> // better use vector, it's needed by others too
|
||||
#include <algorithm> // std::min, std::max
|
||||
|
||||
+2
-4
@@ -9,8 +9,9 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
#include <gtkmm.h>
|
||||
#include <glib.h> // g_, G*
|
||||
|
||||
#include <string>
|
||||
// #include <locale.h> // _configthreadlocale (win32)
|
||||
@@ -21,9 +22,6 @@ Copyright:
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <cmath>
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glib.h> // g_, G*
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
@@ -9,11 +9,8 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ Copyright:
|
||||
#ifndef GSC_MAIN_WINDOW_ICONVIEW_H
|
||||
#define GSC_MAIN_WINDOW_ICONVIEW_H
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <vector>
|
||||
#include <cmath> // std::floor
|
||||
#include <unordered_map>
|
||||
@@ -283,8 +283,8 @@ class GscMainWindowIconView : public Gtk::IconView {
|
||||
name += (drive->get_model_name().empty() ? Glib::ustring("Unknown model") : Glib::Markup::escape_text(drive->get_model_name()));
|
||||
if (rconfig::get_data<bool>("gui/icons_show_device_name")) {
|
||||
if (!drive->get_is_virtual()) {
|
||||
#ifndef _WIN32
|
||||
std::string dev = Glib::Markup::escape_text(drive->get_device_with_type());
|
||||
#ifndef _WIN32
|
||||
name += "\n" + dev;
|
||||
#else
|
||||
name += "\n" + Glib::ustring::compose(_("%1 (%2)"), dev, drive_letters);
|
||||
|
||||
@@ -9,14 +9,11 @@ Copyright:
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
#include "local_glibmm.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <map>
|
||||
#include <type_traits> // std::decay_t
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <memory>
|
||||
|
||||
#include "build_config.h"
|
||||
|
||||
@@ -12,8 +12,8 @@ Copyright:
|
||||
#ifndef GSC_TEXT_WINDOW_H
|
||||
#define GSC_TEXT_WINDOW_H
|
||||
|
||||
#include "local_glibmm.h"
|
||||
#include <gtkmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gdk/gdk.h> // GDK_KEY_Escape
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ Copyright:
|
||||
#define HZ_ENV_TOOLS_H
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
|
||||
/// \def HAVE_SETENV
|
||||
|
||||
@@ -27,7 +27,8 @@ Copyright:
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_GLIB
|
||||
#include <glib/gi18n.h>
|
||||
#include "local_glibmm.h"
|
||||
// #include <glib/gi18n.h> // may cause conflicts with std::*printf()
|
||||
#else
|
||||
#define C_(Context,String) (String)
|
||||
#endif
|
||||
|
||||
+47
-1
@@ -1,5 +1,17 @@
|
||||
/******************************************************************************
|
||||
License: GNU General Public License v3.0 only
|
||||
Copyright:
|
||||
(C) 2008 - 2021 Alexander Shaduri <ashaduri@gmail.com>
|
||||
******************************************************************************/
|
||||
/// \file
|
||||
/// \author Alexander Shaduri
|
||||
/// \ingroup gsc
|
||||
/// \weakgroup gsc
|
||||
/// @{
|
||||
|
||||
#ifndef LOCAL_GLIBMM_H
|
||||
#define LOCAL_GLIBMM_H
|
||||
|
||||
// TODO Remove this in gtkmm4.
|
||||
|
||||
// Glibmm before 2.50.1 uses throw(...) exception specifications which are invalid in C++17.
|
||||
// Try to work around that.
|
||||
@@ -37,3 +49,37 @@
|
||||
#else
|
||||
#include <glibmm.h>
|
||||
#endif
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
// Undo the macros declared by libintl.h (included by glibmm/i18n.h),
|
||||
// they conflict with C++ std:: versions.
|
||||
#undef fprintf
|
||||
#undef vfprintf
|
||||
#undef printf
|
||||
#undef vprintf
|
||||
#undef sprintf
|
||||
#undef vsprintf
|
||||
#undef snprintf
|
||||
#undef vsnprintf
|
||||
#undef asprintf
|
||||
#undef vasprintf
|
||||
#undef fwprintf
|
||||
#undef vfwprintf
|
||||
#undef wprintf
|
||||
#undef vfwprintf
|
||||
#undef swprintf
|
||||
#undef vswprintf
|
||||
#undef fwprintf
|
||||
#undef vfwprintf
|
||||
#undef wprintf
|
||||
#undef vwprintf
|
||||
#undef swprintf
|
||||
#undef vswprintf
|
||||
#undef setlocale
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
|
||||
@@ -12,6 +12,8 @@ Copyright:
|
||||
#ifndef RCONFIG_CONFIG_H
|
||||
#define RCONFIG_CONFIG_H
|
||||
|
||||
#include "json/json.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
@@ -19,7 +21,6 @@ Copyright:
|
||||
|
||||
#include "hz/debug.h"
|
||||
#include "hz/string_algo.h"
|
||||
#include "json/json.hpp"
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user