summaryrefslogtreecommitdiff
path: root/libraries/podofo/XRefStrParObj-deprecated.patch
blob: d2a74b68b5c31170e857a20f5d2d2ba846ddabd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff -Naur podofo-0.9.6.orig/src/base/PdfXRefStreamParserObject.h podofo-0.9.6/src/base/PdfXRefStreamParserObject.h
--- podofo-0.9.6.orig/src/base/PdfXRefStreamParserObject.h	2014-06-06 22:13:22.000000000 +0000
+++ podofo-0.9.6/src/base/PdfXRefStreamParserObject.h	2020-05-03 02:26:01.119538387 +0000
@@ -47,8 +47,11 @@
  * an XRef stream object.
  *
  * It is mainly here to make PdfParser more modular.
+ * This is only marked PODOFO_API for the benefit of the tests,
+ * the class is for internal use only. It is deprecated, so
+ * don't ever rely on it (i.e. externally or in PoDoFo tools).
  */
-class PdfXRefStreamParserObject : public PdfParserObject {
+class PODOFO_DEPRECATED PODOFO_API PdfXRefStreamParserObject : public PdfParserObject {
 public:
 
     /** Parse the object data from the given file handle starting at
diff -Naur podofo-0.9.6.orig/src/base/podofoapi.h podofo-0.9.6/src/base/podofoapi.h
--- podofo-0.9.6.orig/src/base/podofoapi.h	2017-10-27 06:38:19.000000000 +0000
+++ podofo-0.9.6/src/base/podofoapi.h	2020-05-03 02:27:03.874537513 +0000
@@ -173,9 +173,22 @@
 
 /* Set up some other compiler-specific but not platform-specific macros */
 
-#if defined(__GNUC__)
-    /* gcc will issue a warning if a function or variable so annotated is used */
-    #define PODOFO_DEPRECATED       __attribute__((deprecated))
+#ifdef __GNU__
+  #define PODOFO_HAS_GCC_ATTRIBUTE_DEPRECATED 1
+#elif defined(__has_attribute)
+  #if __has_attribute(__deprecated__)
+    #define PODOFO_HAS_GCC_ATTRIBUTE_DEPRECATED 1
+  #endif
+#endif
+
+#ifdef PODOFO_HAS_GCC_ATTRIBUTE_DEPRECATED
+    /* gcc (or compat. clang) will issue a warning if a function or variable so annotated is used */
+    #define PODOFO_DEPRECATED       __attribute__((__deprecated__))
+#else
+    #define PODOFO_DEPRECATED
+#endif
+
+#ifdef __GNU__
     /* gcc can do some additional optimisations on functions annotated as pure.
      * See the documentation on __attribute__((pure)) in the gcc docs. */
     #define PODOFO_PURE_FUNCTION    __attribute__((pure))
@@ -185,9 +198,12 @@
      * (see CODINGSTYLE.txt) .*/
     #define PODOFO_NOTHROW          __attribute__((nothrow))
 #else
-    #define PODOFO_DEPRECATED
-    #define PODOFO_PURE_FUNCTION
-    #define PODOFO_NOTHROW          __declspec(nothrow)
+  #define PODOFO_PURE_FUNCTION
+    #ifdef _MSC_VER
+      #define PODOFO_NOTHROW        __declspec(nothrow)
+    #else
+      #define PODOFO_NOTHROW
+    #endif
 #endif
 
 // Peter Petrov 27 April 2008