Fix mingw build.

This commit is contained in:
Martín Lucas Golini
2023-02-07 13:44:42 -03:00
parent 20d5b2440b
commit 7bccac1c06
30 changed files with 58 additions and 49 deletions

View File

@@ -8,7 +8,7 @@ namespace EE { namespace Graphics {
class EE_API BlendMode {
public:
enum class EE_API Factor {
enum class Factor {
Zero, /// (0, 0, 0, 0)
One, /// (1, 1, 1, 1)
SrcColor, /// (src.r, src.g, src.b, src.a)
@@ -21,7 +21,7 @@ class EE_API BlendMode {
OneMinusDstAlpha /// (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)
};
enum class EE_API Equation {
enum class Equation {
Add, /// Pixel = Src * SrcFactor + Dst * DstFactor
Subtract, /// Pixel = Src * SrcFactor - Dst * DstFactor
ReverseSubtract /// Pixel = Dst * DstFactor - Src * SrcFactor

View File

@@ -17,7 +17,7 @@ class EE_API Glyph {
int rsbDelta{ 0 }; //!< Right offset after forced autohint. Internally used by getKerning()
};
enum class EE_API FontType { TTF, BMF, Sprite };
enum class FontType { TTF, BMF, Sprite };
enum FontHorizontalAlign {
TEXT_ALIGN_LEFT = ( 0 << 0 ),

View File

@@ -14,7 +14,7 @@ class EE_API GlyphDrawable : public DrawableResource {
static GlyphDrawable* New( Texture* texture, const Rect& srcRect,
const std::string& resourceName = "" );
enum class EE_API DrawMode {
enum class DrawMode {
Image, ///< It will be treated as a simple image, no special offset is applied.
Text, ///< Will add the glyph offset corresponding to that character
TextItalic ///< Will add the glyph offset corresponding to that character and simulate

View File

@@ -14,7 +14,7 @@ class Texture;
/** @enum EE::Graphics::ParticleEffect Predefined effects for the particle system. Use Callback when
* wan't to create a new effect, o set the parameters using NoFx, but it's much more limited. */
enum class EE_API ParticleEffect : Uint32 {
enum class ParticleEffect : Uint32 {
Nofx = 0, //!< User defined effect
BlueBall,
Fire,

View File

@@ -12,7 +12,7 @@ using namespace EE::Math;
namespace EE { namespace Graphics {
enum class EE_API PixelDensitySize : Uint32 {
enum class PixelDensitySize : Uint32 {
MDPI = 1, //!< 1dp = 1px
HDPI = 2, //!< 1dp = 1.5px
XHDPI = 3, //!< 1dp = 2px

View File

@@ -13,15 +13,15 @@ namespace EE { namespace Graphics {
class EE_API Texture : public DrawableResource, public Image, private NonCopyable {
public:
/** @enum TextureFilter Defines the texture filter used. */
enum class EE_API Filter : Uint32 {
enum class Filter : Uint32 {
Linear, //!< Linear filtering (Smoothed Zoom)
Nearest //!< No filtering (Pixeled Zoom)
};
/** @enum ClampMode Set the clamp mode of the texture. */
enum class EE_API ClampMode : Uint32 { ClampToEdge, ClampRepeat };
enum class ClampMode : Uint32 { ClampToEdge, ClampRepeat };
enum class EE_API CoordinateType : Uint32 {
enum class CoordinateType : Uint32 {
Normalized, ///< Texture coordinates in range [0 .. 1]
Pixels ///< Texture coordinates in range [0 .. size]
};

View File

@@ -4,7 +4,7 @@
namespace EE { namespace Graphics {
/// VBO default usage type
enum class EE_API VertexBufferUsageType : int {
enum class VertexBufferUsageType : int {
Static,
Dynamic,
Stream,

View File

@@ -17,7 +17,7 @@ class LogReaderInterface {
virtual void writeLog( const std::string& Text ) = 0;
};
enum class EE_API LogLevel : int {
enum class LogLevel : int {
Debug, ///< Detailed debug information.
Info, ///< Interesting events in your application.
Notice, ///< Normal, but significant events in your application.

View File

@@ -11,7 +11,7 @@ using namespace EE::UI::Models;
namespace EE { namespace UI { namespace Abstract {
enum class EE_API ModelEventType { Open, OpenTree, CloseTree, OpenMenu };
enum class ModelEventType { Open, OpenTree, CloseTree, OpenMenu };
class EE_API ModelEvent : public Event {
public:

View File

@@ -15,7 +15,7 @@ using namespace EE::Math;
namespace EE { namespace UI {
class UINode;
enum class EE_API BorderType : Uint32 { Inside, Outside, Outline };
enum class BorderType : Uint32 { Inside, Outside, Outline };
struct EE_API Border {
int width = 0;

View File

@@ -6,7 +6,7 @@
namespace EE { namespace UI { namespace CSS {
enum class EE_API PropertyId : Uint32 {
enum class PropertyId : Uint32 {
Id = String::hash( "id" ),
Class = String::hash( "class" ),
X = String::hash( "x" ),
@@ -209,7 +209,7 @@ enum class EE_API PropertyId : Uint32 {
GravityOwner = String::hash( "gravity-owner" ),
};
enum class EE_API PropertyType : Uint32 {
enum class PropertyType : Uint32 {
Undefined,
String,
Bool,
@@ -227,7 +227,7 @@ enum class EE_API PropertyType : Uint32 {
Time
};
enum class EE_API PropertyRelativeTarget : Uint32 {
enum class PropertyRelativeTarget : Uint32 {
None,
ContainingBlockWidth,
ContainingBlockHeight,

View File

@@ -8,7 +8,7 @@
namespace EE { namespace UI { namespace CSS {
enum class EE_API ShorthandId : Uint32 {
enum class ShorthandId : Uint32 {
Margin = String::hash( "margin" ),
Padding = String::hash( "padding" ),
Transition = String::hash( "transition" ),

View File

@@ -16,7 +16,7 @@ class UIWidget;
namespace EE { namespace UI { namespace CSS {
enum class EE_API AnimationOrigin : uint8_t { User, Animation, Transition };
enum class AnimationOrigin : uint8_t { User, Animation, Transition };
class EE_API StyleSheetPropertyAnimation : public Action {
public:

View File

@@ -9,7 +9,7 @@
namespace EE { namespace UI { namespace CSS {
enum class EE_API AtRuleType : Uint32 { None, FontFace };
enum class AtRuleType : Uint32 { None, FontFace };
class EE_API StyleSheetStyle {
public:

View File

@@ -35,15 +35,15 @@ class EE_API TextDocument {
public:
typedef std::function<void()> DocumentCommand;
enum class EE_API UndoRedo { Undo, Redo };
enum class UndoRedo { Undo, Redo };
enum class EE_API IndentType { IndentSpaces, IndentTabs };
enum class IndentType { IndentSpaces, IndentTabs };
enum class EE_API LineEnding { LF, CRLF, CR };
enum class LineEnding { LF, CRLF, CR };
enum class EE_API FindReplaceType { Normal, LuaPattern };
enum class FindReplaceType { Normal, LuaPattern };
enum class EE_API LoadStatus { Loaded, Interrupted, Failed };
enum class LoadStatus { Loaded, Interrupted, Failed };
static std::string lineEndingToString( const LineEnding& le ) {
switch ( le ) {

View File

@@ -14,7 +14,7 @@ namespace EE { namespace UI { namespace Doc {
class TextDocument;
enum class EE_API TextUndoCommandType { Insert, Remove, Selection };
enum class TextUndoCommandType { Insert, Remove, Selection };
class EE_API TextUndoCommand {
public:

View File

@@ -33,7 +33,7 @@ struct FileEvent {
class EE_API FileSystemModel : public Model {
public:
enum class EE_API Mode { DirectoriesOnly, FilesAndDirectories };
enum class Mode { DirectoriesOnly, FilesAndDirectories };
struct DisplayConfig {
DisplayConfig() {}

View File

@@ -25,7 +25,7 @@ namespace EE { namespace UI { namespace Models {
class PersistentHandle;
enum class EE_API SortOrder { None, Ascending, Descending };
enum class SortOrder { None, Ascending, Descending };
class EE_API Model {
public:
@@ -152,8 +152,8 @@ class EE_API Model {
ModelIndex createIndex( int row, int column, const void* data = nullptr,
const Int64& internalId = 0 ) const;
enum class EE_API OperationType { Invalid = 0, Insert, Move, Delete, Reset };
enum class EE_API Direction { Row, Column };
enum class OperationType { Invalid = 0, Insert, Move, Delete, Reset };
enum class Direction { Row, Column };
struct Operation {
OperationType type{ OperationType::Invalid };

View File

@@ -3,7 +3,7 @@
namespace EE { namespace UI { namespace Models {
enum class EE_API ModelRole { Display, Icon, Sort, Custom };
enum class ModelRole { Display, Icon, Sort, Custom };
}}} // namespace EE::UI::Models

View File

@@ -17,7 +17,7 @@ class EE_API UICodeEditorSplitter {
static const std::map<KeyBindings::Shortcut, std::string> getLocalDefaultKeybindings();
enum class EE_API SplitDirection { Left, Right, Top, Bottom };
enum class SplitDirection { Left, Right, Top, Bottom };
class EE_API Client {
public:

View File

@@ -6,7 +6,7 @@
namespace EE { namespace UI {
enum class EE_API ClipType : Uint32 { None, ContentBox, PaddingBox, BorderBox };
enum class ClipType : Uint32 { None, ContentBox, PaddingBox, BorderBox };
class UIClip {
public:

View File

@@ -105,15 +105,15 @@ enum UINodeType {
UI_TYPE_USER = 100000
};
enum class EE_API ScrollBarMode : Uint32 { Auto, AlwaysOn, AlwaysOff };
enum class ScrollBarMode : Uint32 { Auto, AlwaysOn, AlwaysOff };
enum class EE_API UIOrientation : Uint32 { Vertical, Horizontal };
enum class UIOrientation : Uint32 { Vertical, Horizontal };
enum class EE_API SizePolicy : Uint32 { Fixed, MatchParent, WrapContent };
enum class SizePolicy : Uint32 { Fixed, MatchParent, WrapContent };
enum class EE_API PositionPolicy : Uint32 { None, LeftOf, RightOf, TopOf, BottomOf };
enum class PositionPolicy : Uint32 { None, LeftOf, RightOf, TopOf, BottomOf };
enum class EE_API UIScaleType : Uint32 { None, Expand, FitInside };
enum class UIScaleType : Uint32 { None, Expand, FitInside };
static const Uint32 UI_NODE_DEFAULT_ALIGN = UI_HALIGN_LEFT | UI_VALIGN_CENTER;

View File

@@ -7,7 +7,7 @@
namespace EE { namespace UI {
enum class EE_API InnerWidgetOrientation { Left, Right, Center };
enum class InnerWidgetOrientation { Left, Right, Center };
class EE_API UIPushButton : public UIWidget {
public:

View File

@@ -22,7 +22,7 @@ class UIWidget;
class UILayout;
class UIIcon;
enum class EE_API ColorSchemePreference { Light, Dark };
enum class ColorSchemePreference { Light, Dark };
class EE_API UISceneNode : public SceneNode {
public:

View File

@@ -145,7 +145,7 @@ class EE_API UITreeView : public UIAbstractTableView {
void updateContentSize();
protected:
enum class EE_API IterationDecision {
enum class IterationDecision {
Continue,
Break,
Stop,

View File

@@ -29,7 +29,7 @@ enum WindowStyle {
#endif
};
enum class EE_API WindowBackend : Uint32 { SDL2, Default };
enum class WindowBackend : Uint32 { SDL2, Default };
#ifndef EE_SCREEN_KEYBOARD_ENABLED
#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS

View File

@@ -331,6 +331,12 @@ static_backends = { }
backend_selected = false
remote_sdl2_version = "SDL2-2.0.20"
function build_arch_configuration()
if os.is_real("mingw32") or os.is_real("mingw64") then
buildoptions { "-D__USE_MINGW_ANSI_STDIO=1" }
end
end
function build_base_configuration( package_name )
includedirs { "src/thirdparty/zlib" }
@@ -344,6 +350,7 @@ function build_base_configuration( package_name )
set_ios_config()
set_xcode_config()
build_arch_configuration()
configuration "debug"
defines { "DEBUG" }
@@ -384,6 +391,7 @@ function build_base_cpp_configuration( package_name )
set_ios_config()
set_xcode_config()
build_arch_configuration()
configuration "debug"
defines { "DEBUG", "EE_DEBUG", "EE_MEMORY_MANAGER" }
@@ -549,6 +557,10 @@ function build_link_configuration( package_name, use_ee_icon )
end
end
set_ios_config()
set_xcode_config()
build_arch_configuration()
configuration "debug"
defines { "DEBUG", "EE_DEBUG", "EE_MEMORY_MANAGER" }
flags { "Symbols" }
@@ -608,9 +620,6 @@ function build_link_configuration( package_name, use_ee_icon )
if _OPTIONS["with-gles2"] and not _OPTIONS["force-gles1"] then
linkoptions{ "-s FULL_ES2=1" }
end
set_ios_config()
set_xcode_config()
end
function generate_os_links()

View File

@@ -177,10 +177,10 @@ end
function build_arch_configuration()
filter {"architecture:x86", "options:cc=mingw"}
buildoptions { "-B /usr/bin/i686-w64-mingw32-" }
buildoptions { "-D__USE_MINGW_ANSI_STDIO=1 -B /usr/bin/i686-w64-mingw32-" }
filter {"architecture:x86_64", "options:cc=mingw"}
buildoptions { "-B /usr/bin/x86_64-w64-mingw32-" }
buildoptions { "-D__USE_MINGW_ANSI_STDIO=1 -B /usr/bin/x86_64-w64-mingw32-" }
end
function build_base_configuration( package_name )

View File

@@ -198,7 +198,7 @@ bool FileSystem::fileWrite( const std::string& filepath, const std::string& data
bool FileSystem::fileRemove( const std::string& filepath ) {
#if EE_PLATFORM == EE_PLATFORM_WIN
return DeleteFile( String( filepath ).toWideString().c_str() );
return DeleteFileW( String( filepath ).toWideString().c_str() );
#else
return 0 == remove( filepath.c_str() );
#endif
@@ -300,7 +300,7 @@ bool FileSystem::isDirectory( const std::string& path ) {
static inline bool eepp_mkdir( const std::string& path, const Uint16& mode ) {
#if EE_PLATFORM == EE_PLATFORM_WIN
return 0 != CreateDirectory( String( path ).toWideString().c_str(), NULL );
return 0 != CreateDirectoryW( String( path ).toWideString().c_str(), NULL );
#else
int v;
v = mkdir( path.c_str(), mode );