api: add deprecated syntax for deprecated apis.
authorHermet Park <chuneon.park@samsung.com>
Thu, 5 Aug 2021 02:15:10 +0000 (11:15 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 6 Aug 2021 01:04:08 +0000 (10:04 +0900)
inc/thorvg.h

index a8c3bf7..6c622c3 100644 (file)
 #include <string>
 
 #ifdef TVG_BUILD
-    #define TVG_EXPORT __attribute__ ((visibility ("default")))
+    #ifdef _MSC_VER
+        #define TVG_EXPORT __declspec(dllexport)
+        #define TVG_DEPRECATED __declspec(deprecated)
+    #else
+        #define TVG_EXPORT __attribute__ ((visibility ("default")))
+        #define TVG_DEPRECATED __attribute__ ((__deprecated__))
+    #endif
 #else
     #define TVG_EXPORT
+    #define TVG_DEPRECATED
 #endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
 #define _TVG_DECLARE_PRIVATE(A) \
 protected: \
     struct Impl; \
@@ -1013,11 +1019,10 @@ public:
      * @retval Result::Unknown If an error occurs at a later stage.
      *
      * @warning: you have responsibility to release the @p data memory if the @p copy is true
-     *
-     * @deprecated This method will go away next release.
-     * @see load(data, size, mimeType, copy)
+     * @deprecated Use load(const char* data, uint32_t size, const std::string& mimeType, bool copy) instead.
+     * @see Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept
      */
-    Result load(const char* data, uint32_t size, bool copy = false) noexcept;
+    TVG_DEPRECATED Result load(const char* data, uint32_t size, bool copy = false) noexcept;
 
     /**
      * @brief Loads a picture data from a memory block of a given size.
@@ -1033,6 +1038,8 @@ public:
      * @retval Result::Unknown If an error occurs at a later stage.
      *
      * @warning: you have responsibility to release the @p data memory if the @p copy is true
+     *
+     * @BETA_API
      */
     Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept;