From: TimePath Date: Sat, 20 Feb 2016 05:04:48 +0000 (+1100) Subject: Appveyor X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cc16097053fb4e5fec2dc179583d536a6ecdb75a;p=xonotic%2Fnetradiant.git Appveyor --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 74e26787..59ea517e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,8 @@ if (NOT WIN32) include_directories(${X11_INCLUDE_DIR}) else () add_definitions( - -D_WIN32 + -DWIN32=1 + -D_WIN32=1 ) endif () diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..dab50ed2 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,28 @@ +platform: x64 + +shallow_clone: true + +install: + - set "PATH=C:\msys64\usr\bin;%PATH%" + - bash -lc "pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel" + - ps: >- + bash -lc @" + exec 0&1 + pacman --noconfirm -Su + pacman --noconfirm --needed -S base-devel mingw-w64-x86_64-{toolchain,clang,cmake,gtk2,gtkglext} + "@ + +build_script: + - set HOME=. + - set MSYSTEM=MINGW64 + - ps: >- + bash -lc @" + set -e + exec 0&1 + # export CC=clang + # export CXX=clang++ + mkdir build && cd build + cmake --version + cmake -G 'MSYS Makefiles' .. -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw64/lib/gtk-2.0/include + cmake --build . --target radiant + "@ diff --git a/libs/gtkutil/filechooser.cpp b/libs/gtkutil/filechooser.cpp index 177e752e..46cc3f8b 100644 --- a/libs/gtkutil/filechooser.cpp +++ b/libs/gtkutil/filechooser.cpp @@ -263,7 +263,7 @@ const char* file_dialog( ui::Widget parent, bool open, const char* title, const if ( open || file == nullptr || !file_exists( file ) - || parent.alert("The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::QUESTION ) == ui::alert_response::YES ) { + || parent.alert("The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::Question ) == ui::alert_response::YES ) { return file; } } diff --git a/libs/l_net/l_net_wins.c b/libs/l_net/l_net_wins.c index c47ff265..436a9929 100644 --- a/libs/l_net/l_net_wins.c +++ b/libs/l_net/l_net_wins.c @@ -31,7 +31,6 @@ #include #include -#include #include #include "l_net.h" #include "l_net_wins.h" diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index a567a531..eb49165a 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -34,11 +34,11 @@ namespace ui { type == alert_type::YESNOCANCEL ? eMB_YESNOCANCEL : type == alert_type::NOYES ? eMB_NOYES : eMB_OK, - icon == alert_icon::DEFAULT ? eMB_ICONDEFAULT : - icon == alert_icon::ERROR ? eMB_ICONERROR : - icon == alert_icon::WARNING ? eMB_ICONWARNING : - icon == alert_icon::QUESTION ? eMB_ICONQUESTION : - icon == alert_icon::ASTERISK ? eMB_ICONASTERISK : + icon == alert_icon::Default ? eMB_ICONDEFAULT : + icon == alert_icon::Error ? eMB_ICONERROR : + icon == alert_icon::Warning ? eMB_ICONWARNING : + icon == alert_icon::Question ? eMB_ICONQUESTION : + icon == alert_icon::Asterisk ? eMB_ICONASTERISK : eMB_ICONDEFAULT ); return diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 96a6ddce..562d0b08 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -55,11 +55,11 @@ namespace ui { }; enum class alert_icon { - DEFAULT, - ERROR, - WARNING, - QUESTION, - ASTERISK, + Default, + Error, + Warning, + Question, + Asterisk, }; enum class alert_response { @@ -116,7 +116,7 @@ namespace ui { { } alert_response alert(std::string text, std::string title = "NetRadiant", - alert_type type = alert_type::OK, alert_icon icon = alert_icon::DEFAULT); + alert_type type = alert_type::OK, alert_icon icon = alert_icon::Default); const char *file_dialog(bool open, const char *title, const char *path = nullptr, const char *pattern = nullptr, bool want_load = false, bool want_import = false, diff --git a/radiant/console.cpp b/radiant/console.cpp index 8ca6f2ef..34627fd8 100644 --- a/radiant/console.cpp +++ b/radiant/console.cpp @@ -70,7 +70,7 @@ void Sys_LogFile( bool enable ){ } else{ ui::root.alert( "Failed to create log file, check write permissions in Radiant directory.\n", - "Console logging", ui::alert_type::OK, ui::alert_icon::ERROR ); + "Console logging", ui::alert_type::OK, ui::alert_icon::Error ); } } else if ( !enable && g_hLogFile != 0 ) { diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index be8a56d5..3c5a74b7 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -699,7 +699,7 @@ static ui::Widget text_editor; static ui::Widget text_widget; // slave, text widget from the gtk editor static gint editor_delete( ui::Widget widget, gpointer data ){ - if ( widget.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::QUESTION ) == ui::alert_response::NO ) { + if ( widget.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) { return TRUE; } @@ -723,7 +723,7 @@ static void editor_save( ui::Widget widget, gpointer data ){ } static void editor_close( ui::Widget widget, gpointer data ){ - if ( text_editor.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::QUESTION ) == ui::alert_response::NO ) { + if ( text_editor.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) { return; } @@ -1040,7 +1040,7 @@ void DoTextEditor( const char* filename, int cursorpos ){ #ifdef WIN32 if ( g_TextEditor_useWin32Editor ) { globalOutputStream() << "opening file '" << filename << "' (line " << cursorpos << " info ignored)\n"; - ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), "open", filename, 0, 0, SW_SHOW ); + ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", filename, 0, 0, SW_SHOW ); return; } #else diff --git a/radiant/main.cpp b/radiant/main.cpp index d7e2d467..b28ab9f8 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -310,12 +310,12 @@ bool handleMessage(){ ScopedLock lock( m_lock ); #if defined _DEBUG m_buffer << "Break into the debugger?\n"; - bool handled = ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::YESNO, ui::alert_icon::ERROR ) == ui::alert_response::NO; + bool handled = ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::YESNO, ui::alert_icon::Error ) == ui::alert_response::NO; m_buffer.clear(); return handled; #else m_buffer << "Please report this error to the developers\n"; - ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::OK, ui::alert_icon::ERROR ); + ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::OK, ui::alert_icon::Error ); m_buffer.clear(); #endif } @@ -440,7 +440,7 @@ void create_global_pid(){ if ( remove( g_pidFile.c_str() ) == -1 ) { StringOutputStream msg( 256 ); msg << "WARNING: Could not delete " << g_pidFile.c_str(); - ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::ERROR ); + ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error ); } // in debug, never prompt to clean registry, turn console logging auto after a failed start @@ -481,7 +481,7 @@ void remove_global_pid(){ if ( remove( g_pidFile.c_str() ) == -1 ) { StringOutputStream msg( 256 ); msg << "WARNING: Could not delete " << g_pidFile.c_str(); - ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::ERROR ); + ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error ); } } @@ -499,7 +499,7 @@ void create_local_pid(){ if ( remove( g_pidGameFile.c_str() ) == -1 ) { StringOutputStream msg; msg << "WARNING: Could not delete " << g_pidGameFile.c_str(); - ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::ERROR ); + ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error ); } // in debug, never prompt to clean registry, turn console logging auto after a failed start diff --git a/radiant/patch.h b/radiant/patch.h index 9e1bb16d..b5c0c480 100644 --- a/radiant/patch.h +++ b/radiant/patch.h @@ -30,6 +30,8 @@ /// The surface is recursively tesselated until the angle between each triangle /// edge is smaller than a specified tolerance. +#define _USE_MATH_DEFINES +#include #include "nameable.h" #include "ifilter.h" diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index efb97643..3cb542ad 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -489,7 +489,7 @@ static void OnButtonClean( ui::Widget widget, gpointer data ){ // make sure this is what the user wants if ( ui::Widget(GTK_WIDGET( g_Preferences.GetWidget() )).alert( "This will close Radiant and clean the corresponding registry entries.\n" "Next time you start Radiant it will be good as new. Do you wish to continue?", - "Reset Registry", ui::alert_type::YESNO, ui::alert_icon::ASTERISK ) == ui::alert_response::YES ) { + "Reset Registry", ui::alert_type::YESNO, ui::alert_icon::Asterisk ) == ui::alert_response::YES ) { PrefsDlg *dlg = (PrefsDlg*)data; dlg->EndModal( eIDCANCEL ); diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 02386ca4..5ccc8fde 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -141,7 +141,7 @@ bool ConfirmModified( const char* title ){ return true; } - auto result = MainFrame_getWindow().alert( "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::QUESTION ); + auto result = MainFrame_getWindow().alert( "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::Question ); if ( result == ui::alert_response::CANCEL ) { return false; } diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 2739f866..ce3bf0f8 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -2271,7 +2271,7 @@ void TextureBrowser_deleteTag(){ gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected ); if ( g_slist_length( selected ) == 1 ) { // we only delete a single tag - auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::QUESTION ); + auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::Question ); if ( result == ui::alert_response::YES ) { GtkTreeIter iterSelected; @@ -2392,7 +2392,7 @@ void TextureBrowser_showAll(){ } void TextureBrowser_showUntagged(){ - auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::WARNING ); + auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning ); if ( result == ui::alert_response::YES ) { g_TextureBrowser.m_found_shaders.clear(); diff --git a/radiant/url.cpp b/radiant/url.cpp index 1885f44b..5bda229a 100644 --- a/radiant/url.cpp +++ b/radiant/url.cpp @@ -28,7 +28,7 @@ #include #include bool open_url( const char* url ){ - return ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32; + return ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32; } #endif diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index b66a33a8..1725dc86 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -520,7 +520,7 @@ void CWatchBSP::DoEBeginStep(){ if ( SetupListening() == false ) { const char* msg = "Failed to get a listening socket on port 39000.\nTry running with Build monitoring disabled if you can't fix this.\n"; globalOutputStream() << msg; - MainFrame_getWindow().alert( msg, "Build monitoring", ui::alert_type::OK, ui::alert_icon::ERROR ); + MainFrame_getWindow().alert( msg, "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error ); return; } // set the timer for timeouts and step cancellation @@ -537,7 +537,7 @@ void CWatchBSP::DoEBeginStep(){ msg << reinterpret_cast( g_ptr_array_index( m_pCmd, m_iCurrentStep ) ); msg << "\nCheck that the file exists and that you don't run out of system resources.\n"; globalOutputStream() << msg.c_str(); - MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::ERROR ); + MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error ); return; } // re-initialise the debug window @@ -750,7 +750,7 @@ void CWatchBSP::RoutineProcessing(){ StringOutputStream msg; msg << "Failed to execute the following command: " << cmd.c_str() << cmdline.c_str(); globalOutputStream() << msg.c_str(); - MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::ERROR ); + MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error ); } } EndMonitoringLoop(); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index abebef5d..528d52ec 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -1488,7 +1488,7 @@ void WXY_BackgroundSelect( void ){ bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0; if ( !brushesSelected ) { ui::root.alert( "You have to select some brushes to get the bounding box for.\n", - "No selection", ui::alert_type::OK, ui::alert_icon::ERROR ); + "No selection", ui::alert_type::OK, ui::alert_icon::Error ); return; }