From f822fb1468a3ecac2dbb64701d3c55e4868ee10e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 5 Oct 2021 18:33:02 +0200 Subject: [PATCH] REVIEWED: API functions specifiers --- .../controls_test_suite/controls_test_suite.c | 2 ++ src/raygui.h | 32 ++++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/examples/controls_test_suite/controls_test_suite.c b/examples/controls_test_suite/controls_test_suite.c index 93faf01..6386903 100644 --- a/examples/controls_test_suite/controls_test_suite.c +++ b/examples/controls_test_suite/controls_test_suite.c @@ -39,6 +39,8 @@ #define RAYGUI_IMPLEMENTATION #include "../../src/raygui.h" +#include // Required for: strcpy() + //------------------------------------------------------------------------------------ // Program main entry point //------------------------------------------------------------------------------------ diff --git a/src/raygui.h b/src/raygui.h index 71c71e6..c1395c0 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raygui v3.0-dev - A simple and easy-to-use immediate-mode gui library +* raygui v3.0 - A simple and easy-to-use immediate-mode gui library * * DESCRIPTION: * @@ -159,7 +159,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2014-2020 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2021 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -181,31 +181,27 @@ #ifndef RAYGUI_H #define RAYGUI_H -#define RAYGUI_VERSION "3.0-dev" +#define RAYGUI_VERSION "3.0" #if !defined(RAYGUI_STANDALONE) #include "raylib.h" #endif -// Functions qualifiers/attributes definition +// Function specifiers definition #ifndef RAYGUIAPI - #define RAYGUIAPI // We are defining our functions as 'extern' by default (implicit attribute) + #define RAYGUIAPI // Functions defined as 'extern' by default (implicit specifiers) #endif -// Function qualifiers in case library is build/used as a shared library +// Function specifiers in case library is build/used as a shared library (Windows) +// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll #if defined(_WIN32) - // Microsoft attributes to tell compiler that symbols are imported/exported from a .dll #if defined(BUILD_LIBTYPE_SHARED) - #define RAYGUIAPI __declspec(dllexport) // We are building this library as a Win32 shared library (.dll) + #define RAYGUIAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) #elif defined(USE_LIBTYPE_SHARED) - #define RAYGUIAPI __declspec(dllimport) // We are using this library as a Win32 shared library (.dll) + #define RAYGUIAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) #endif #endif -#if !defined(RAYGUI_MALLOC) && !defined(RAYGUI_CALLOC) && !defined(RAYGUI_FREE) - #include // Required for: malloc(), calloc(), free() -#endif - // Allow custom memory allocators #ifndef RAYGUI_MALLOC #define RAYGUI_MALLOC(sz) malloc(sz) @@ -561,14 +557,12 @@ RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pi #if defined(RAYGUI_IMPLEMENTATION) -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() -#include // Required for: strlen() [GuiTextBox()] +#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()] +#include // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()] +#include // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy() +#include // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()] #include // Required for: roundf() [GuiColorPicker()] -#if defined(RAYGUI_STANDALONE) - #include // Required for: va_list, va_start(), vfprintf(), va_end() -#endif - #ifdef __cplusplus #define RAYGUI_CLITERAL(name) name #else