xash3d-fwgs/engine/platform/irix/dladdr.c
Xav101 9466461ce0
engine: preliminary support for SGI IRIX (#1211)
* Added definitions for IRIX

* Patchset to get dedicated server to compile on IRIX.

* Cleaned up debug statements in wscript

* Potential bug in IRIX implementation of isnan? For now just use the portable macro.

* Include the platform port files in the build

* Temporary execution script for setting appropriate library search paths to the right locations in the build directory. This should probably get replaced with a more permanent script at some point which lives in the same directory as the normal xash binary, or be replaced by a solution that sets the rpath during config or modifies rpath during install.

* Clean up formatting and remove unneeded debugging statements

* Added GPL copyright notice and description

* Moved to irix platform folder and edited script

* Re-introduced _inline macro

* Replace spaces with tabs

Co-authored-by: Xav101 <xaviernye@msn.com>
2023-01-14 09:35:30 +03:00

40 lines
1.3 KiB
C

/*
dladdr.c - dladdr implementation for SGI IRIX
Copyright (C) 2022 Xav101
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
/*
* From SGI IRIX's 'man dladdr'
*
* <dlfcn.h> does not contain a prototype for dladdr or definition of
* Dl_info. The #include <dlfcn.h> in the SYNOPSIS line is traditional,
* but contains no dladdr prototype and no IRIX library contains an
* implementation. Write your own declaration based on the code below.
*
* The following code is dependent on internal interfaces that are not
* part of the IRIX compatibility guarantee; however, there is no future
* intention to change this interface, so on a practical level, the code
* below is safe to use on IRIX.
*
*
*
* The following code has been reproduced from the manpage.
*/
#include "dladdr.h"
int dladdr(void *address, Dl_info* dl)
{
void *v;
v = _rld_new_interface(_RLD_DLADDR, address, dl);
return (int)v;
}