Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
epics-modules
require
Commits
9f647b32
Commit
9f647b32
authored
17 years ago
by
zimoch
Browse files
Options
Downloads
Patches
Plain Diff
allow backward compatible minor versions in require
parent
056c3ef8
No related branches found
Branches containing commit
Tags
misc_1_5_1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
require.c
+15
-4
15 additions, 4 deletions
require.c
with
15 additions
and
4 deletions
require.c
+
15
−
4
View file @
9f647b32
...
...
@@ -43,6 +43,12 @@ int require(char* lib, char* version)
char
dbdname
[
256
];
char
depname
[
256
];
/* try to find module in local /bin directory first, then in path
prefer *Lib.munch file over *Lib file
check for dependencies in *.dep file
load *.dbd file if it exists
*/
/* first try local library */
if
(
version
)
{
...
...
@@ -165,17 +171,22 @@ int require(char* lib, char* version)
/* Library already loaded. Check Version. */
if
(
version
&&
strcmp
(
loaded
,
version
)
!=
0
)
{
/* non-numerical versions must match exactly
numerical versions must have exact match in major version and
backward-compatible match in minor version and patch level
*/
int
lmajor
,
lminor
,
lpatch
,
lmatches
;
int
major
,
minor
,
patch
,
matches
;
lmatches
=
sscanf
(
loaded
,
"%d.%d.%d"
,
&
lmajor
,
&
lminor
,
&
lpatch
);
matches
=
sscanf
(
version
,
"%d.%d.%d"
,
&
major
,
&
minor
,
&
patch
);
if
(
matches
==
0
||
lmatches
==
0
/* non-numerical version*/
if
(((
matches
==
0
||
lmatches
==
0
)
&&
strcmp
(
loaded
,
version
)
!=
0
)
||
major
!=
lmajor
||
(
matches
>=
2
&&
minor
!=
lminor
)
||
(
matches
>
2
&&
patch
!=
lpatch
))
||
(
matches
>=
2
&&
minor
>
lminor
)
||
(
matches
>
2
&&
minor
==
lminor
&&
patch
>
lpatch
))
{
printf
(
"
Version c
onflict between requested %s
\n
"
printf
(
"
C
onflict between requested
version
%s
\n
"
"and already loaded version %s.
\n
"
"Aborting startup stript.
\n
"
,
lib
,
loaded
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment