Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
0d579a43
Unverified
Commit
0d579a43
authored
Aug 16, 2023
by
alanminko
Committed by
GitHub
Aug 16, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #240 from QuantamHD/fix_windows_build
map: Fixes windows fnmatch build issue
parents
5405d478
aae3a399
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
src/map/scl/sclLiberty.c
+14
-1
No files found.
src/map/scl/sclLiberty.c
View file @
0d579a43
...
@@ -18,7 +18,12 @@
...
@@ -18,7 +18,12 @@
***********************************************************************/
***********************************************************************/
#include <string.h>
#include <string.h>
#ifdef _WIN32
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
#else
#include <fnmatch.h>
#include <fnmatch.h>
#endif
#include "sclLib.h"
#include "sclLib.h"
#include "misc/st/st.h"
#include "misc/st/st.h"
...
@@ -75,6 +80,14 @@ struct Scl_Tree_t_
...
@@ -75,6 +80,14 @@ struct Scl_Tree_t_
Vec_Str_t
*
vBuffer
;
// temp string buffer
Vec_Str_t
*
vBuffer
;
// temp string buffer
};
};
static
inline
int
Scl_LibertyGlobMatch
(
const
char
*
pattern
,
const
char
*
string
)
{
#ifdef _WIN32
return
PathMatchSpec
(
string
,
pattern
);
#else
return
fnmatch
(
pattern
,
string
,
0
)
==
0
;
#endif
}
static
inline
Scl_Item_t
*
Scl_LibertyRoot
(
Scl_Tree_t
*
p
)
{
return
p
->
pItems
;
}
static
inline
Scl_Item_t
*
Scl_LibertyRoot
(
Scl_Tree_t
*
p
)
{
return
p
->
pItems
;
}
static
inline
Scl_Item_t
*
Scl_LibertyItem
(
Scl_Tree_t
*
p
,
int
v
)
{
assert
(
v
<
p
->
nItems
);
return
v
<
0
?
NULL
:
p
->
pItems
+
v
;
}
static
inline
Scl_Item_t
*
Scl_LibertyItem
(
Scl_Tree_t
*
p
,
int
v
)
{
assert
(
v
<
p
->
nItems
);
return
v
<
0
?
NULL
:
p
->
pItems
+
v
;
}
static
inline
int
Scl_LibertyCompare
(
Scl_Tree_t
*
p
,
Scl_Pair_t
Pair
,
char
*
pStr
)
{
return
strncmp
(
p
->
pContents
+
Pair
.
Beg
,
pStr
,
Pair
.
End
-
Pair
.
Beg
)
||
((
int
)
strlen
(
pStr
)
!=
Pair
.
End
-
Pair
.
Beg
);
}
static
inline
int
Scl_LibertyCompare
(
Scl_Tree_t
*
p
,
Scl_Pair_t
Pair
,
char
*
pStr
)
{
return
strncmp
(
p
->
pContents
+
Pair
.
Beg
,
pStr
,
Pair
.
End
-
Pair
.
Beg
)
||
((
int
)
strlen
(
pStr
)
!=
Pair
.
End
-
Pair
.
Beg
);
}
...
@@ -646,7 +659,7 @@ int Scl_LibertyReadCellIsDontUse( Scl_Tree_t * p, Scl_Item_t * pCell, SC_DontUse
...
@@ -646,7 +659,7 @@ int Scl_LibertyReadCellIsDontUse( Scl_Tree_t * p, Scl_Item_t * pCell, SC_DontUse
return
1
;
return
1
;
const
char
*
cell_name
=
Scl_LibertyReadString
(
p
,
pCell
->
Head
);
const
char
*
cell_name
=
Scl_LibertyReadString
(
p
,
pCell
->
Head
);
for
(
int
i
=
0
;
i
<
dont_use
.
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
dont_use
.
size
;
i
++
)
{
if
(
fnmatch
(
dont_use
.
dont_use_list
[
i
],
cell_name
,
0
)
==
0
)
{
if
(
Scl_LibertyGlobMatch
(
dont_use
.
dont_use_list
[
i
],
cell_name
)
)
{
return
1
;
return
1
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment