aboutsummaryrefslogtreecommitdiff
path: root/ports/freetype/0003-Fix-UWP.patch
blob: b3a04188c642d458e6a915daaedf90a3b25694dc (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
62
63
64
65
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db48e9f..5c35276 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -328,6 +328,10 @@ else ()
   list(APPEND BASE_SRCS src/base/ftdebug.c)
 endif ()
 
+if(MSVC)
+  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
+endif()
+
 if (BUILD_FRAMEWORK)
   list(APPEND BASE_SRCS builds/mac/freetype-Info.plist)
 endif ()
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 4f2eaca..1e01fe4 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1038,6 +1038,11 @@ FT_BEGIN_HEADER
    *   Especially for TrueType fonts see also the documentation for
    *   @FT_Size_Metrics.
    */
+   
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define generic GenericFromFreeTypeLibrary
+#endif
+
   typedef struct  FT_FaceRec_
   {
     FT_Long           num_faces;
@@ -1910,6 +1915,9 @@ FT_BEGIN_HEADER
 
   } FT_GlyphSlotRec;
 
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#undef generic
+#endif
 
   /*************************************************************************/
   /*************************************************************************/
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 3f8619d..edf03b6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -528,6 +528,9 @@
     return error;
   }
 
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define generic GenericFromFreeTypeLibrary
+#endif
 
   static void
   ft_glyphslot_clear( FT_GlyphSlot  slot )
@@ -1195,6 +1198,9 @@
     FT_FREE( face );
   }
 
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#undef generic
+#endif
 
   static void
   Destroy_Driver( FT_Driver  driver )