Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository 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
Simon Wilson
KWSys
Commits
e81e2b72
Commit
e81e2b72
authored
12 years ago
by
Alan Hourihane
Committed by
Brad King
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
DynamicLoader: Implement on Atari FreeMINT
Change-Id: I63c5e599f8d2a66b448356e8920039ddecdd8431
parent
6fa1c99f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DynamicLoader.cxx
+52
-0
52 additions, 0 deletions
DynamicLoader.cxx
with
52 additions
and
0 deletions
DynamicLoader.cxx
+
52
−
0
View file @
e81e2b72
...
...
@@ -428,6 +428,58 @@ const char* DynamicLoader::LastError()
}
// namespace KWSYS_NAMESPACE
#endif
#ifdef __MINT__
#define DYNAMICLOADER_DEFINED 1
#define _GNU_SOURCE
/* for program_invocation_name */
#include
<string.h>
#include
<malloc.h>
#include
<errno.h>
#include
<dld.h>
namespace
KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader
::
LibraryHandle
DynamicLoader
::
OpenLibrary
(
const
char
*
libname
)
{
char
*
name
=
(
char
*
)
calloc
(
1
,
strlen
(
libname
)
+
1
);
dld_init
(
program_invocation_name
);
strncpy
(
name
,
libname
,
strlen
(
libname
));
dld_link
(
libname
);
return
(
void
*
)
name
;
}
//----------------------------------------------------------------------------
int
DynamicLoader
::
CloseLibrary
(
DynamicLoader
::
LibraryHandle
lib
)
{
dld_unlink_by_file
((
char
*
)
lib
,
0
);
free
(
lib
);
return
0
;
}
//----------------------------------------------------------------------------
DynamicLoader
::
SymbolPointer
DynamicLoader
::
GetSymbolAddress
(
DynamicLoader
::
LibraryHandle
lib
,
const
char
*
sym
)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
{
void
*
pvoid
;
DynamicLoader
::
SymbolPointer
psym
;
}
result
;
result
.
pvoid
=
dld_get_symbol
(
sym
);
return
result
.
psym
;
}
//----------------------------------------------------------------------------
const
char
*
DynamicLoader
::
LastError
()
{
return
dld_strerror
(
dld_errno
);
}
}
// namespace KWSYS_NAMESPACE
#endif
// ---------------------------------------------------------------
// 6. Implementation for default UNIX machines.
// if nothing has been defined then use this
...
...
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