Check for C11, use pragma once

This commit is contained in:
Tim Warren 2016-01-13 09:29:09 -05:00
parent a7ecaccc88
commit ab0c586b25
17 changed files with 28 additions and 82 deletions

View File

@ -9,6 +9,15 @@ project(Tyro)
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include)
# C11, please
include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-std=c11" COMPILER_SUPPORTS_C11)
if (COMPILER_SUPPORTS_C11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
endif()
# C++11, please
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)

View File

@ -1,5 +1,5 @@
sonar.projectKey=tyro
sonar.projectName=tyro
sonar.projectName=Tyro
sonar.projectVersion=1.0.0
sonar.sources=src
sonar.language=c++

View File

@ -5,8 +5,7 @@
* Created on April 6, 2015, 2:22 PM
*/
#ifndef SFTP_H
#define SFTP_H
#pragma once
#include "../common.h"
@ -52,6 +51,3 @@ private:
void ssh_connect();
void sftp_connect();
};
#endif /* SFTP_H */

View File

@ -1,8 +1,7 @@
/**
* A common header for global includes
*/
#ifndef TYRO_COMMON_H
#define TYRO_COMMON_H
#pragma once
// C++ Standard Lib includes
#include <iostream>
@ -25,7 +24,4 @@ typedef Json::Writer JsonWriter;
// Typedef some common templates
typedef map<string, int> StringConstMap;
typedef map<string, string> StringMap;
typedef vector<string> StringVector;
#endif // TYRO_COMMON_H
typedef vector<string> StringVector;

View File

@ -1,9 +1,7 @@
/**
* Miscellaneous Program-specific definitions
*/
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#pragma once
// Application config
const wxString APP_NAME = "Tyro";
@ -136,7 +134,4 @@ const wxString TYRO_FILE_SAVE_WILDCARDS =
"Shell (*.sh, *.bsh)|*.sh;*.bsh|"
"SQL (*.sql)|*.sql|"
"Text (*.txt)|*.txt|"
"Yaml (.yml,*.yaml)| *.yml;*.yaml";
#endif /* DEFINITIONS_H */
"Yaml (.yml,*.yaml)| *.yml;*.yaml";

View File

@ -1,5 +1,4 @@
#ifndef TYRO_CONFIG_H
#define TYRO_CONFIG_H
#pragma once
#include "src/common.h"
@ -13,7 +12,3 @@ private:
JsonValue default_root;
JsonReader reader;
};
#endif /* TYRO_CONFIG_H */

View File

@ -1,5 +1,4 @@
#ifndef TYRO_LANG_CONFIG_H
#define TYRO_LANG_CONFIG_H
#pragma once
#include "src/wx_common.h"
#include "src/settings/Config.h"
@ -20,5 +19,3 @@ private:
string lang;
StringMap reverseMap;
};
#endif

View File

@ -1,9 +1,7 @@
/**
* Theme manager
*/
#ifndef TYRO_THEME_CONFIG_H
#define TYRO_THEME_CONFIG_H
#pragma once
#include "src/wx_common.h"
#include "src/settings/Config.h"
@ -20,5 +18,3 @@ private:
JsonValue current_theme;
};
#endif /* TYRO_THEME_CONFIG_H */

View File

@ -1,6 +1,4 @@
#ifndef TYROEDIT_PANE_H
#define TYROEDIT_PANE_H
#pragma once
#include "src/widgets/widget.h"
#include "src/settings/LangConfig.h"
#include "src/settings/ThemeConfig.h"
@ -36,5 +34,3 @@ protected:
void SetTheme(string theme_name);
void _ApplyTheme(JsonValue &lexer_map);
};
#endif // TYRODOC_FRAME_H

View File

@ -70,11 +70,6 @@ void FilePane::CreateTree(const wxString &path, wxTreeListItem &root)
for (wxString filename : *files)
{
wxFileName fname(filename);
/*if (fname.IsRelative())
{
fname.MakeAbsolute();
}*/
// For loose files, just add directly to the tree
if (fname.GetDirCount() == 1)

View File

@ -1,5 +1,4 @@
#ifndef TYRO_FILE_PANE_H
#define TYRO_FILE_PANE_H
#pragma once
#include "src/widgets/widget.h"
@ -23,5 +22,3 @@ private:
void CreateTree(const wxString &path, wxTreeListItem &root);
};
#endif /* TYRO_FILE_PANE_H */

View File

@ -1,9 +1,7 @@
/**
* Main Application Frame
*/
#ifndef TYROMAIN_H
#define TYROMAIN_H
#pragma once
#include "src/widgets/TyroMenu.h"
#include "src/widgets/EditPane.h"
@ -55,6 +53,3 @@ class MainFrame: public wxFrame
void OnQuit(wxCommandEvent &event);
void OnAbout(wxCommandEvent &event);
};
#endif // TYROMAIN_H

View File

@ -1,9 +1,7 @@
/**
* Preference Panes
*/
#ifndef TYRO_PREF_PANE_H
#define TYRO_PREF_PANE_H
#pragma once
#include "src/widgets/widget.h"
@ -17,5 +15,3 @@ protected:
wxPreferencesEditor *pref_window = nullptr;
};
#endif /* TYRO_PREF_PANE_H */

View File

@ -1,9 +1,7 @@
/**
* Wrapper around wxAuiNotebook
*/
#ifndef TABCONTAINER_H
#define TABCONTAINER_H
#pragma once
#include "src/widgets/TyroMenu.h"
#include "src/widgets/EditPane.h"
@ -37,5 +35,3 @@ private:
void OnTabContextMenu(wxAuiNotebookEvent &event);
};
#endif /* TABCONTAINER_H */

View File

@ -1,8 +1,7 @@
/**
* Main Menu class
*/
#ifndef TYRO_MENU_H
#define TYRO_MENU_H
#pragma once
#include "src/widgets/widget.h"
@ -22,7 +21,4 @@ private:
void SetupMainMenus();
void SetupLangMenu();
void EnableEntireMenu(size_t menuId, wxMenu *menu, bool enable);
};
#endif /* TYRO_MENU_H */
};

View File

@ -1,8 +1,7 @@
/**
* Common header for widgets
*/
#ifndef TYRO_WIDGET_H
#define TYRO_WIDGET_H
#pragma once
// Common wxWidgets stuff
#include "src/wx_common.h"
@ -18,6 +17,3 @@
#include <wx/treelist.h>
#include <wx/preferences.h>
#endif /* TYRO_WIDGET_H */

View File

@ -1,9 +1,7 @@
/**
* Common header for widget classes
*/
#ifndef WX_COMMON_H
#define WX_COMMON_H
#pragma once
#include "common.h"
@ -53,7 +51,4 @@ static inline bool HAS_FONT_BUG()
}
// Tyro-specific variables
#include "definitions.h"
#endif /* WX_COMMON_H */
#include "definitions.h"