diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2018-09-30 21:47:39 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2018-10-01 22:50:12 +0000 |
| commit | 172dbd2b94199731c1bbd2f789e55535188ade5c (patch) | |
| tree | 907ca31a726661673f72eb35c2a8431e0dc57873 /src | |
| parent | config.h - remove all defines we never use (diff) | |
| download | inkscape-172dbd2b94199731c1bbd2f789e55535188ade5c.tar.gz inkscape-172dbd2b94199731c1bbd2f789e55535188ade5c.zip | |
Use _WIN32 instead of WIN32
The former is guaranteed to be set for any compiler targeting win32,
the latter is implementation dependent (but works for gcc)
See also
http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
Diffstat (limited to 'src')
37 files changed, 92 insertions, 92 deletions
diff --git a/src/document.cpp b/src/document.cpp index 792e6fe4b..af5c2f2a3 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -346,7 +346,7 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, g_free(document->name); document->name = nullptr; } -#ifndef WIN32 +#ifndef _WIN32 document->uri = prepend_current_dir_if_relative(uri); #else // FIXME: it may be that prepend_current_dir_if_relative works OK on windows too, test! @@ -890,7 +890,7 @@ void SPDocument::do_change_uri(gchar const *const filename, bool const rebase) gchar *new_uri = nullptr; if (filename) { -#ifndef WIN32 +#ifndef _WIN32 new_uri = prepend_current_dir_if_relative(filename); #else // FIXME: it may be that prepend_current_dir_if_relative works OK on windows too, test! diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 3c9861aee..c6fcd0e7a 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -261,7 +261,7 @@ Extension::check () // No need to include Windows only extensions // See LP bug #1307554 for details - https://bugs.launchpad.net/inkscape/+bug/1307554 -#ifndef WIN32 +#ifndef _WIN32 const char* win_ext[] = {"com.vaxxine.print.win32"}; std::vector<std::string> v (win_ext, win_ext + sizeof(win_ext)/sizeof(win_ext[0])); std::string ext_id(id); diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 11961458a..9e0dd31c8 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -51,7 +51,7 @@ #include "path-prefix.h" -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #include <sys/stat.h> #include "registrytool.h" @@ -86,7 +86,7 @@ void Script::pump_events () { */ Script::interpreter_t const Script::interpreterTab[] = { {"perl", "perl-interpreter", "perl" }, -#ifdef WIN32 +#ifdef _WIN32 {"python", "python-interpreter", "pythonw" }, #else {"python", "python-interpreter", "python" }, diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 679db9f6a..f7de8d85f 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -50,7 +50,7 @@ #include "object/sp-clippath.h" #include "util/units.h" -#ifdef WIN32 +#ifdef _WIN32 #include "libnrtype/FontFactory.h" // USE_PANGO_WIN32 #endif @@ -270,7 +270,7 @@ bool CairoRenderContext::setPdfTarget(gchar const *utf8_fn) if (*fn == '|') { fn += 1; while (isspace(*fn)) fn += 1; -#ifndef WIN32 +#ifndef _WIN32 osp = popen(fn, "w"); #else osp = _popen(fn, "w"); @@ -297,7 +297,7 @@ bool CairoRenderContext::setPdfTarget(gchar const *utf8_fn) gchar *qn = ( *fn ? g_strdup_printf("lpr -P %s", fn) /* FIXME: quote fn */ : g_strdup("lpr") ); -#ifndef WIN32 +#ifndef _WIN32 osp = popen(qn, "w"); #else osp = _popen(qn, "w"); @@ -352,7 +352,7 @@ bool CairoRenderContext::setPsTarget(gchar const *utf8_fn) if (*fn == '|') { fn += 1; while (isspace(*fn)) fn += 1; -#ifndef WIN32 +#ifndef _WIN32 osp = popen(fn, "w"); #else osp = _popen(fn, "w"); @@ -379,7 +379,7 @@ bool CairoRenderContext::setPsTarget(gchar const *utf8_fn) gchar *qn = ( *fn ? g_strdup_printf("lpr -P %s", fn) /* FIXME: quote fn */ : g_strdup("lpr") ); -#ifndef WIN32 +#ifndef _WIN32 osp = popen(qn, "w"); #else osp = _popen(qn, "w"); diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp index 7848927ca..b86fb5049 100644 --- a/src/extension/internal/cdr-input.cpp +++ b/src/extension/internal/cdr-input.cpp @@ -233,7 +233,7 @@ void CdrImportDialog::_setPreviewPage() SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { - #ifdef WIN32 + #ifdef _WIN32 // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows // therefore attempt to convert uri to the system codepage // even if this is not possible the alternate short (8.3) file name will be used if available diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 21a91fa34..df04b2322 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -710,7 +710,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { // PDFDoc is from poppler. PDFDoc is used for preview and for native import. -#ifndef WIN32 +#ifndef _WIN32 // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from // glib gstdio.c GooString *filename_goo = new GooString(uri); diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp index a0b41a990..783fcfc8b 100644 --- a/src/extension/internal/vsd-input.cpp +++ b/src/extension/internal/vsd-input.cpp @@ -233,7 +233,7 @@ void VsdImportDialog::_setPreviewPage() SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { - #ifdef WIN32 + #ifdef _WIN32 // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows // therefore attempt to convert uri to the system codepage // even if this is not possible the alternate short (8.3) file name will be used if available diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index a1c27e3e3..32e3a91f2 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -81,7 +81,7 @@ namespace Internal { SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { - #ifdef WIN32 + #ifdef _WIN32 // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows // therefore attempt to convert uri to the system codepage // even if this is not possible the alternate short (8.3) file name will be used if available diff --git a/src/file.cpp b/src/file.cpp index 12b8fe0da..97c61298b 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -82,7 +82,7 @@ using Inkscape::IO::Resource::USER; #include "extension/dbus/dbus-init.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #endif @@ -467,7 +467,7 @@ sp_file_open_dialog(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) open_path = ""; -#ifdef WIN32 +#ifdef _WIN32 //# If no open path, default to our win32 documents folder if (open_path.empty()) { diff --git a/src/helper/gettext.cpp b/src/helper/gettext.cpp index 226304267..e985267b7 100644 --- a/src/helper/gettext.cpp +++ b/src/helper/gettext.cpp @@ -27,7 +27,7 @@ # include "config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #endif @@ -43,7 +43,7 @@ namespace Inkscape { /** does all required gettext initialization and takes care of the respective locale directory paths */ void initialize_gettext() { -#ifdef WIN32 +#ifdef _WIN32 gchar *datadir = g_win32_get_package_installation_directory_of_module(NULL); // obtain short path to executable dir and pass it @@ -90,7 +90,7 @@ void bind_textdomain_codeset_utf8() { * for now do something even easier - switch console encoding to UTF8 and be done with it! * this also works nicely on MSYS consoles where UTF8 encoding is used by default, too */ void bind_textdomain_codeset_console() { -#ifdef WIN32 +#ifdef _WIN32 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); #else std::string charset; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 67bedb1f8..ca145202c 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -70,7 +70,7 @@ static void (* segv_handler) (int) = SIG_DFL; static void (* abrt_handler) (int) = SIG_DFL; static void (* fpe_handler) (int) = SIG_DFL; static void (* ill_handler) (int) = SIG_DFL; -#ifndef WIN32 +#ifndef _WIN32 static void (* bus_handler) (int) = SIG_DFL; #endif @@ -78,7 +78,7 @@ static void (* bus_handler) (int) = SIG_DFL; #define SP_INDENT 8 -#ifdef WIN32 +#ifdef _WIN32 typedef int uid_t; #define getuid() 0 #endif @@ -449,7 +449,7 @@ Application::Application(const char* argv, bool use_gui) : abrt_handler = signal (SIGABRT, Application::crash_handler); fpe_handler = signal (SIGFPE, Application::crash_handler); ill_handler = signal (SIGILL, Application::crash_handler); -#ifndef WIN32 +#ifndef _WIN32 bus_handler = signal (SIGBUS, Application::crash_handler); #endif @@ -518,7 +518,7 @@ Application::Application(const char* argv, bool use_gui) : /* DebugDialog redirection. On Linux, default to OFF, on Win32, default to ON. * Use only if use_gui is enabled */ -#ifdef WIN32 +#ifdef _WIN32 #define DEFAULT_LOG_REDIRECT true #else #define DEFAULT_LOG_REDIRECT false @@ -613,7 +613,7 @@ Application::crash_handler (int /*signum*/) signal (SIGABRT, abrt_handler ); signal (SIGFPE, fpe_handler ); signal (SIGILL, ill_handler ); -#ifndef WIN32 +#ifndef _WIN32 signal (SIGBUS, bus_handler ); #endif diff --git a/src/inkview.cpp b/src/inkview.cpp index a8823e5a0..eb2355437 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -109,7 +109,7 @@ get_valid_files(std::vector<Glib::ustring> filenames, return valid_files; } -#ifdef WIN32 +#ifdef _WIN32 // minimal print handler (just prints the string to stdout) void g_print_no_convert(const gchar *buf) { fputs(buf, stdout); } void g_printerr_no_convert(const gchar *buf) { fputs(buf, stderr); } @@ -117,7 +117,7 @@ void g_printerr_no_convert(const gchar *buf) { fputs(buf, stderr); } int main (int argc, char **argv) { -#ifdef WIN32 +#ifdef _WIN32 // Ugly hack to make g_print emit UTF-8 encoded characters. Otherwise glib will *always* // perform character conversion to the system's ANSI code page making UTF-8 output impossible. g_set_print_handler(g_print_no_convert); diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 72cf3c2f9..fd110492e 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -20,7 +20,7 @@ #include "config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include <shlobj.h> // for SHGetSpecialFolderLocation #endif @@ -378,7 +378,7 @@ char *profile_path(const char *filename) prefdir = g_strdup(userenv); } -#ifdef WIN32 +#ifdef _WIN32 // prefer c:\Documents and Settings\UserName\Application Data\ to c:\Documents and Settings\userName\; // TODO: CSIDL_APPDATA is C:\Users\UserName\AppData\Roaming these days // should we migrate to AppData\Local? Then we can simply use the portable g_get_user_config_dir() diff --git a/src/io/sys.cpp b/src/io/sys.cpp index c56119fb0..af6e964b7 100644 --- a/src/io/sys.cpp +++ b/src/io/sys.cpp @@ -16,7 +16,7 @@ #endif #include <fstream> -#ifdef WIN32 +#ifdef _WIN32 #include <fcntl.h> #include <io.h> #endif @@ -78,7 +78,7 @@ FILE *Inkscape::IO::fopen_utf8name( char const *utf8name, char const *mode ) Glib::ustring how( mode ); if ( how.find("w") != Glib::ustring::npos ) { -#ifdef WIN32 +#ifdef _WIN32 setmode(fileno(stdout), O_BINARY); #endif return stdout; diff --git a/src/io/uristream.cpp b/src/io/uristream.cpp index 0b38dbc84..ff4cca74d 100644 --- a/src/io/uristream.cpp +++ b/src/io/uristream.cpp @@ -49,7 +49,7 @@ static FILE *fopen_utf8name( char const *utf8name, int mode ) return nullptr; } -#ifndef WIN32 +#ifndef _WIN32 gchar *filename = g_filename_from_utf8( utf8name, -1, nullptr, nullptr, nullptr ); if ( filename ) { if (mode == FILE_READ) diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 0c2c55f75..964544077 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -791,7 +791,7 @@ void font_factory::AddFontsDir(char const *utf8dir) } gchar *dir; -# ifdef WIN32 +# ifdef _WIN32 dir = g_win32_locale_filename_from_utf8(utf8dir); # else dir = g_filename_from_utf8(utf8dir, -1, nullptr, nullptr, nullptr); @@ -823,7 +823,7 @@ void font_factory::AddFontFile(char const *utf8file) } gchar *file; -# ifdef WIN32 +# ifdef _WIN32 file = g_win32_locale_filename_from_utf8(utf8file); # else file = g_filename_from_utf8(utf8file, -1, nullptr, nullptr, nullptr); diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp index a43bc3769..856a369f8 100644 --- a/src/livarot/Path.cpp +++ b/src/livarot/Path.cpp @@ -813,7 +813,7 @@ Type1 fonts because they use cubic-paths instead of the bezier-paths used by True-Type fonts." */ -#ifdef WIN32 +#ifdef _WIN32 Geom::Point np = nData->p - nData->end; if ( np[Geom::X] < l ) { l = np[Geom::X]; diff --git a/src/main.cpp b/src/main.cpp index 43c2a11d0..bb9010bfa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,10 +97,10 @@ #include <extension/output.h> #include <extension/input.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #include "registrytool.h" -#endif // WIN32 +#endif // _WIN32 #include "extension/init.h" // Not ideal, but there doesn't appear to be a nicer system in place for @@ -305,7 +305,7 @@ static void resetCommandlineGlobals() { sp_global_printer_utf8 = nullptr; } -#ifdef WIN32 +#ifdef _WIN32 static bool replaceArgs( int& argc, char**& argv ); #endif static std::vector<gchar *> sp_process_args(poptContext ctx); @@ -578,7 +578,7 @@ gchar * blankParam = g_strdup(""); -#ifdef WIN32 +#ifdef _WIN32 /** * Set up the PATH, INKSCAPE_LOCALEDIR and PYTHONPATH environment @@ -640,7 +640,7 @@ main(int argc, char **argv) Inkscape::initialize_gettext(); #endif -#ifdef WIN32 +#ifdef _WIN32 gchar *datadir = g_win32_get_package_installation_directory_of_module(NULL); _win32_set_inkscape_env(datadir); g_free(datadir); @@ -665,7 +665,7 @@ main(int argc, char **argv) gboolean use_gui; -#if !defined(WIN32) && !defined(GDK_WINDOWING_QUARTZ) +#if !defined(_WIN32) && !defined(GDK_WINDOWING_QUARTZ) use_gui = (g_getenv("DISPLAY") != nullptr); #else use_gui = TRUE; @@ -725,12 +725,12 @@ main(int argc, char **argv) } } -#ifdef WIN32 +#ifdef _WIN32 { // If the call fails, we'll need to convert charsets needToRecodeParams = !replaceArgs( argc, argv ); } -#endif // WIN32 +#endif // _WIN32 int retcode; @@ -975,7 +975,7 @@ sp_main_gui(int argc, char const **argv) Glib::signal_idle().connect(sigc::ptr_fun(&Inkscape::CmdLineAction::idle)); main_instance.run(); -#ifdef WIN32 +#ifdef _WIN32 //We might not need anything here //sp_win32_finish(); <-- this is a NOP func #endif @@ -1846,7 +1846,7 @@ static int do_export_xaml(SPDocument* doc, gchar const* uri, char const* mime) return do_export_win_metafile_common(doc, uri, mime); } -#ifdef WIN32 +#ifdef _WIN32 bool replaceArgs( int& argc, char**& argv ) { bool worked = false; @@ -2120,7 +2120,7 @@ bool replaceArgs( int& argc, char**& argv ) return worked; } -#endif // WIN32 +#endif // _WIN32 static std::vector<gchar *> sp_process_args(poptContext ctx) diff --git a/src/object/color-profile.cpp b/src/object/color-profile.cpp index 38064022a..f010efe33 100644 --- a/src/object/color-profile.cpp +++ b/src/object/color-profile.cpp @@ -20,7 +20,7 @@ #include <io/sys.h> #include <io/resource.h> -#ifdef WIN32 +#ifdef _WIN32 #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. Required for correctly including icm.h #define _WIN32_WINDOWS 0x0410 #endif @@ -46,9 +46,9 @@ #include <glibmm/convert.h> #include "uri.h" -#ifdef WIN32 +#ifdef _WIN32 #include <icm.h> -#endif // WIN32 +#endif // _WIN32 using Inkscape::ColorProfile; using Inkscape::ColorProfileImpl; @@ -788,7 +788,7 @@ std::set<ColorProfile::FilePlusHome> ColorProfile::getBaseProfileDirs() { g_free(path); } -#ifdef WIN32 +#ifdef _WIN32 wchar_t pathBuf[MAX_PATH + 1]; pathBuf[0] = 0; DWORD pathSize = sizeof(pathBuf); @@ -802,7 +802,7 @@ std::set<ColorProfile::FilePlusHome> ColorProfile::getBaseProfileDirs() { } g_free( utf8Path ); } -#endif // WIN32 +#endif // _WIN32 return sources; } diff --git a/src/object/sp-namedview.cpp b/src/object/sp-namedview.cpp index b6f7d7373..0618485d2 100644 --- a/src/object/sp-namedview.cpp +++ b/src/object/sp-namedview.cpp @@ -785,7 +785,7 @@ void sp_namedview_window_from_document(SPDesktop *desktop) } } if ((w > 0) && (h > 0)) { -#ifndef WIN32 +#ifndef _WIN32 gint dx= 0; gint dy = 0; gint dw = 0; diff --git a/src/path-prefix.cpp b/src/path-prefix.cpp index 94945964c..b79f2b48f 100644 --- a/src/path-prefix.cpp +++ b/src/path-prefix.cpp @@ -73,7 +73,7 @@ gchar *get_extensions_path() gchar *extdir; gchar *new_pythonpath; -#ifdef WIN32 +#ifdef _WIN32 extdir = g_win32_locale_filename_from_utf8(INKSCAPE_EXTENSIONDIR); #else extdir = g_strdup(INKSCAPE_EXTENSIONDIR); @@ -107,7 +107,7 @@ gchar *get_datadir_path() using namespace Inkscape::IO::Resource; gchar *datadir; -#ifdef WIN32 +#ifdef _WIN32 datadir = g_win32_locale_filename_from_utf8(profile_path("")); #else datadir = profile_path(""); diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 16095cdad..c2bd173be 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -222,7 +222,7 @@ static char const preferences_skeleton[] = " <group id=\"transparency\"\n" " on-focus=\"1.0\"\n" " on-blur=\"0.50\"\n" -#ifdef WIN32 +#ifdef _WIN32 " animate-time=\"0\"\n" // apparently windows sucks (flickers) #else " animate-time=\"100\"\n" // time to change in ms @@ -286,7 +286,7 @@ static char const preferences_skeleton[] = " <group id=\"svgeditor\" value=\"inkscape\"/>\n" " <group id=\"bitmapautoreload\" value=\"1\"/>\n" " <group id=\"dialogtype\" value=\"1\"/>\n" -#ifdef WIN32 +#ifdef _WIN32 " <group id=\"desktopintegration\" value=\"1\"/>\n" #endif " <group id=\"dock\" " @@ -294,7 +294,7 @@ static char const preferences_skeleton[] = " dockbarstyle=\"2\"" // GDL_DOCK_BAR_BOTH " switcherstyle=\"2\"/>\n" // GDL_SWITCHER_STYLE_BOTH " <group id=\"dialogsskiptaskbar\" value=\"1\"/>\n" -#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs +#ifdef _WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs " <group id=\"dialogsontopwin32\" value=\"0\"/>\n" #endif #if !defined(GDK_WINDOWING_QUARTZ) // No maximise for Quartz, see lp:1302627 diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index a56529dea..299c82905 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -85,7 +85,7 @@ #define CLIPBOARD_TEXT_TARGET "text/plain" -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #endif @@ -1149,7 +1149,7 @@ SPDocument *ClipboardManagerImpl::_retrieveClipboard(Glib::ustring required_targ bool file_saved = false; Glib::ustring target = best_target; -#ifdef WIN32 +#ifdef _WIN32 if (best_target == "CF_ENHMETAFILE" || best_target == "WCF_ENHMETAFILE") { // Try to save clipboard data as en emf file (using win32 api) if (OpenClipboard(NULL)) { @@ -1397,7 +1397,7 @@ Glib::ustring ClipboardManagerImpl::_getBestTarget() return *i; } } -#ifdef WIN32 +#ifdef _WIN32 if (OpenClipboard(NULL)) { // If both bitmap and metafile are present, pick the one that was exported first. UINT format = EnumClipboardFormats(0); @@ -1463,7 +1463,7 @@ void ClipboardManagerImpl::_setClipboardTargets() sigc::mem_fun(*this, &ClipboardManagerImpl::_onGet), sigc::mem_fun(*this, &ClipboardManagerImpl::_onClear)); -#ifdef WIN32 +#ifdef _WIN32 // If the "image/x-emf" target handled by the emf extension would be // presented as a CF_ENHMETAFILE automatically (just like an "image/bmp" // is presented as a CF_BITMAP) this code would not be needed.. ??? diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp index 361a68f93..a3e9e9e78 100644 --- a/src/ui/contextmenu.cpp +++ b/src/ui/contextmenu.cpp @@ -753,7 +753,7 @@ void ContextMenu::ImageEdit() Glib::ustring name; Glib::ustring fullname; -#ifdef WIN32 +#ifdef _WIN32 // g_spawn_command_line_sync parsing is done according to Unix shell rules, // not Windows command interpreter rules. Thus we need to enclose the // executable path with single quotes. diff --git a/src/ui/dialog-events.cpp b/src/ui/dialog-events.cpp index cf11490f3..cc9c8f0bd 100644 --- a/src/ui/dialog-events.cpp +++ b/src/ui/dialog-events.cpp @@ -148,7 +148,7 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) void sp_transientize(GtkWidget *dialog) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); -#ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs +#ifndef _WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs // _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs // are made transient (_set_transient_for), they are already removed from // the taskbar in Win32. @@ -159,7 +159,7 @@ void sp_transientize(GtkWidget *dialog) gint transient_policy = prefs->getIntLimited("/options/transientpolicy/value", 1, 0, 2); -#ifdef WIN32 // Win32 special code to enable transient dialogs +#ifdef _WIN32 // Win32 special code to enable transient dialogs transient_policy = 2; #endif @@ -185,7 +185,7 @@ sp_transientize_callback ( SPDesktop *desktop, win_data *wd ) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gint transient_policy = prefs->getIntLimited( "/options/transientpolicy/value", 1, 0, 2); -#ifdef WIN32 // Win32 special code to enable transient dialogs +#ifdef _WIN32 // Win32 special code to enable transient dialogs transient_policy = 1; #endif diff --git a/src/ui/dialog/dock-behavior.cpp b/src/ui/dialog/dock-behavior.cpp index 7d1131a5f..1f679d5d2 100644 --- a/src/ui/dialog/dock-behavior.cpp +++ b/src/ui/dialog/dock-behavior.cpp @@ -224,7 +224,7 @@ DockBehavior::onDesktopActivated(SPDesktop *desktop) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gint transient_policy = prefs->getIntLimited( "/options/transientpolicy/value", 1, 0, 2); -#ifdef WIN32 // Win32 special code to enable transient dialogs +#ifdef _WIN32 // Win32 special code to enable transient dialogs transient_policy = 2; #endif diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index f484f7e47..e153ed8f0 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -61,7 +61,7 @@ #include "extension/output.h" -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #include <commdlg.h> #include <gdk/gdkwin32.h> @@ -1313,7 +1313,7 @@ void Export::onBrowse () gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (fs), filename.c_str()); -#ifdef WIN32 +#ifdef _WIN32 // code in this section is borrowed from ui/dialogs/filedialogimpl-win32.cpp OPENFILENAMEW opf; WCHAR filter_string[20]; diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp index df3c4a307..fd192a6fb 100644 --- a/src/ui/dialog/filedialog.cpp +++ b/src/ui/dialog/filedialog.cpp @@ -15,7 +15,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#ifdef WIN32 +#ifdef _WIN32 # include "filedialogimpl-win32.h" # include "preferences.h" #endif @@ -89,7 +89,7 @@ FileOpenDialog *FileOpenDialog::create(Gtk::Window &parentWindow, FileDialogType fileTypes, const char *title) { -#ifdef WIN32 +#ifdef _WIN32 FileOpenDialog *dialog = NULL; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool( "/options/desktopintegration/value")) { @@ -124,7 +124,7 @@ FileSaveDialog *FileSaveDialog::create(Gtk::Window& parentWindow, const gchar *docTitle, const Inkscape::Extension::FileSaveMethod save_method) { -#ifdef WIN32 +#ifdef _WIN32 FileSaveDialog *dialog = NULL; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool( "/options/desktopintegration/value")) { diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index c57594551..8f4ff0feb 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -11,7 +11,7 @@ * * Released under GNU GPL, read the file 'COPYING' for more information */ -#ifdef WIN32 +#ifdef _WIN32 #ifdef HAVE_CONFIG_H # include <config.h> @@ -1926,7 +1926,7 @@ UINT_PTR CALLBACK FileSaveDialogImplWin32::GetSaveFileName_hookproc( } } } // namespace Dialog, UI, Inkscape -#endif // ifdef WIN32 +#endif // ifdef _WIN32 /* Local Variables: diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h index 182247703..5c9043a30 100644 --- a/src/ui/dialog/filedialogimpl-win32.h +++ b/src/ui/dialog/filedialogimpl-win32.h @@ -12,7 +12,7 @@ #include <glibmm.h> -#ifdef WIN32 +#ifdef _WIN32 #include "filedialogimpl-gtkmm.h" diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index dccbd76b7..1581a5020 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -184,7 +184,7 @@ FloatingBehavior::onDesktopActivated (SPDesktop *desktop) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gint transient_policy = prefs->getIntLimited("/options/transientpolicy/value", 1, 0, 2); -#ifdef WIN32 // Win32 special code to enable transient dialogs +#ifdef _WIN32 // Win32 special code to enable transient dialogs transient_policy = 2; #endif diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 84550dbf4..b10948229 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -60,7 +60,7 @@ #ifdef HAVE_ASPELL # include <aspell.h> -# ifdef WIN32 +# ifdef _WIN32 # include <windows.h> # endif #endif @@ -610,7 +610,7 @@ void InkscapePreferences::symbolicThemeCheck() folder.erase(0, last_slash_idx + 1); } if (folder == prefs->getString("/theme/iconTheme")) { -#ifdef WIN32 +#ifdef _WIN32 path += g_win32_locale_filename_from_utf8("/symbolic/actions"); #else path += "/symbolic/actions"; @@ -953,7 +953,7 @@ void InkscapePreferences::initPageUI() _("Dockable")); _page_windows.add_line( true, "", _win_floating, "", _("Floating")); -#ifdef WIN32 +#ifdef _WIN32 _page_windows.add_group_header( _("Desktop integration")); _page_windows.add_line( true, "", _win_native, "", _("Use Windows like open and save dialogs")); @@ -961,7 +961,7 @@ void InkscapePreferences::initPageUI() _("Use GTK open and save dialogs ")); #endif -#ifndef WIN32 // non-Win32 special code to enable transient dialogs +#ifndef _WIN32 // non-Win32 special code to enable transient dialogs _page_windows.add_group_header( _("Dialogs on top:")); _page_windows.add_line( true, "", _win_ontop_none, "", @@ -982,7 +982,7 @@ void InkscapePreferences::initPageUI() _page_windows.add_group_header( _("Miscellaneous")); -#ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs +#ifndef _WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs _page_windows.add_line( true, "", _win_hide_task, "", _("Whether dialog windows are to be hidden in the window manager taskbar")); #endif @@ -2118,7 +2118,7 @@ void InkscapePreferences::initPageSpellcheck() AspellConfig *config = new_aspell_config(); -#ifdef WIN32 +#ifdef _WIN32 // on windows, dictionaries are in a lib/aspell-0.60 subdir off inkscape's executable dir; // this is some black magick to find out the executable path to give it to aspell char exeName[MAX_PATH+1]; diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp index 972f2d1f9..267b52423 100644 --- a/src/ui/dialog/spellcheck.cpp +++ b/src/ui/dialog/spellcheck.cpp @@ -39,7 +39,7 @@ #include <glibmm/i18n.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #endif @@ -312,7 +312,7 @@ SpellCheck::init(SPDesktop *d) gtk_widget_set_sensitive(dictionary_combo, false); start_button.set_sensitive(false); -#ifdef WIN32 +#ifdef _WIN32 // on windows, dictionaries are in a lib/aspell-0.60 subdir off inkscape's executable dir; // this is some black magick to find out the executable path to give it to aspell char exeName[MAX_PATH+1]; @@ -330,7 +330,7 @@ SpellCheck::init(SPDesktop *d) #ifdef HAVE_ASPELL { AspellConfig *config = new_aspell_config(); -#ifdef WIN32 +#ifdef _WIN32 aspell_config_replace(config, "prefix", exeName); #endif aspell_config_replace(config, "lang", _lang.c_str()); @@ -347,7 +347,7 @@ SpellCheck::init(SPDesktop *d) if (_lang2 != "") { AspellConfig *config = new_aspell_config(); -#ifdef WIN32 +#ifdef _WIN32 aspell_config_replace(config, "prefix", exeName); #endif aspell_config_replace(config, "lang", _lang2.c_str()); @@ -364,7 +364,7 @@ SpellCheck::init(SPDesktop *d) if (_lang3 != "") { AspellConfig *config = new_aspell_config(); -#ifdef WIN32 +#ifdef _WIN32 aspell_config_replace(config, "prefix", exeName); #endif aspell_config_replace(config, "lang", _lang3.c_str()); diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index ffeeb2ec9..c6e5cb98e 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -714,7 +714,7 @@ class REVENGE_API RVNGSVGDrawingGenerator_WithTitle : public RVNGSVGDrawingGener // Read Visio stencil files SPDocument* read_vss(Glib::ustring filename, Glib::ustring name ) { gchar *fullname; - #ifdef WIN32 + #ifdef _WIN32 // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows // therefore attempt to convert uri to the system codepage // even if this is not possible the alternate short (8.3) file name will be used if available diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index bf5630857..e55bbe2af 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -41,7 +41,7 @@ #include "ui/widget/preferences-widget.h" -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #endif @@ -805,7 +805,7 @@ void PrefEntryFileButtonHBox::onRelatedButtonClickedCallback() (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) open_path = ""; -#ifdef WIN32 +#ifdef _WIN32 //# If no open path, default to our win32 documents folder if (open_path.empty()) { @@ -907,7 +907,7 @@ void PrefOpenFolder::onRelatedButtonClickedCallback() { g_mkdir_with_parents(relatedEntry->get_text().c_str(), 0700); // https://stackoverflow.com/questions/42442189/how-to-open-spawn-a-file-with-glib-gtkmm-in-windows -#ifdef WIN32 +#ifdef _WIN32 ShellExecute(NULL, "open", relatedEntry->get_text().c_str(), NULL, NULL, SW_SHOWDEFAULT); #elif defined(__APPLE__) system(("open " + relatedEntry->get_text()).c_str()); diff --git a/src/winconsole.cpp b/src/winconsole.cpp index f91b19c5c..b34b83c3e 100644 --- a/src/winconsole.cpp +++ b/src/winconsole.cpp @@ -38,7 +38,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#ifdef WIN32 +#ifdef _WIN32 #undef DATADIR #include <windows.h> diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index 630882ed3..5d8f270b0 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -249,7 +249,7 @@ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_b } // Other bitmaps are either really absolute, or already relative. -#ifdef WIN32 +#ifdef _WIN32 /* Windows relative path needs their native separators before we * compare it to native baserefs. */ if ( !Glib::path_is_absolute(href) ) { @@ -278,7 +278,7 @@ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_b ? abs_href.c_str() : nullptr )); if (!Glib::path_is_absolute(new_href)) { -#ifdef WIN32 +#ifdef _WIN32 /* Native Windows path separators are replaced with / so that the href * also works on Gnu/Linux and OSX */ std::replace(new_href.begin(), new_href.end(), '\\', '/'); |
