forked from flathub/tv.kodi.Kodi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fstrcmp.patch
140 lines (139 loc) · 3.13 KB
/
fstrcmp.patch
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,107 @@
+cmake_minimum_required(VERSION 3.0)
+
+project(fstrcmp VERSION 0.7 LANGUAGES C)
+
+if(MSVC)
+ set(CMAKE_DEBUG_POSTFIX "d")
+endif()
+
+add_library(${PROJECT_NAME}
+ lib/ac/assert.h
+ lib/ac/ctype.h
+ lib/ac/errno.h
+ lib/ac/fcntl.h
+ lib/ac/getopt.h
+ lib/ac/pthread.h
+ lib/ac/pwd.h
+ lib/ac/stdarg.h
+ lib/ac/stddef.h
+ lib/ac/stdio.h
+ lib/ac/stdlib.h
+ lib/ac/string.c
+ lib/ac/string.h
+ lib/ac/sys/stat.h
+ lib/ac/sys/time.h
+ lib/ac/sys/types.h
+ lib/ac/unistd.h
+ lib/ac/wchar.h
+ lib/config.h.in
+ lib/config.messy.h
+ lib/diffseq.h
+ lib/downcase.c
+ lib/downcase.h
+ lib/fmemcmp.c
+ lib/fmemcmpi.c
+ lib/fstrcasecmp.c
+ lib/fstrcasecmpi.c
+ lib/fstrcmp.c
+ lib/fstrcmp.h
+ lib/fstrcmpi.c
+ lib/fstrcoll.c
+ lib/fstrcolli.c
+ lib/fwcscmp.c
+ lib/fwcscmpi.c
+ lib/gcc_attributes.h
+ lib/mbs_to_wcs.c
+ lib/mbs_to_wcs.h
+ lib/minmax.h
+ lib/nmalloc.c
+ lib/nmalloc.h
+ lib/patchlevel.h
+ lib/version.c
+ lib/version.h
+ lib/version_print.c
+ lib/version_print.h
+ lib/warn_unused_result.h
+)
+
+target_include_directories(${PROJECT_NAME}
+ PRIVATE
+ ${CMAKE_SOURCE_DIR}
+)
+
+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS -Dssize_t=intptr_t)
+endif()
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY AnyNewerVersion
+)
+
+install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+
+install(FILES lib/fstrcmp.h DESTINATION include)
+
+if(MSVC)
+ set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} COMPILE_PDB_NAME ${PROJECT_NAME} COMPILE_PDB_NAME_DEBUG ${PROJECT_NAME}d)
+ install(FILES ${PROJECT_BINARY_DIR}/RelWithDebInfo/${PROJECT_NAME}.pdb DESTINATION lib CONFIGURATIONS RelWithDebInfo)
+ install(FILES ${PROJECT_BINARY_DIR}/Debug/${PROJECT_NAME}d.pdb DESTINATION lib CONFIGURATIONS Debug)
+endif()
+
+install(EXPORT ${PROJECT_NAME}
+ FILE
+ ${PROJECT_NAME}.cmake
+ NAMESPACE
+ ${PROJECT_NAME}::
+ DESTINATION
+ lib/cmake/${PROJECT_NAME}
+)
+
+install(FILES
+ ${PROJECT_NAME}-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
+ DESTINATION
+ lib/cmake/${PROJECT_NAME}
+)
+
+export(TARGETS ${PROJECT_NAME}
+ FILE
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
+ NAMESPACE ${PROJECT_NAME}::
+)
--- /dev/null
+++ b/fstrcmp-config.cmake
@@ -0,0 +1 @@
+include(${CMAKE_CURRENT_LIST_DIR}/fstrcmp.cmake)
--- /dev/null
+++ b/lib/config.h
@@ -0,0 +1,3 @@
+#define HAVE_STRING_H 1
+#define HAVE_STRERROR 1
+#define HAVE_STDLIB_H 1
diff --git a/lib/program_name.c b/lib/program_name.c
index 725af51..e2eb631 100644
--- a/lib/program_name.c
+++ b/lib/program_name.c
@@ -86,6 +86,7 @@ fstrcmp_program_name_get(void)
/*
* Does procfs have something useful?
*/
+#if !defined(_MSC_VER)
{
int n;
char buf[2000];
@@ -97,6 +98,7 @@ fstrcmp_program_name_get(void)
fstrcmp_program_name_set_real(buf);
}
}
+#endif
if (progname[0])
return progname;