mirror of
https://github.com/postgres/postgres.git
synced 2025-08-05 07:41:25 +03:00
Drop const cast from dlsym() calls
This workaround might be obsolete. We'll see if those "older platforms" mentioned in the comment are still around. Discussion: https://www.postgresql.org/message-id/08adbe4e-38f8-2c73-55f0-591392371687%402ndquadrant.com
This commit is contained in:
@@ -121,12 +121,8 @@ load_external_function(const char *filename, const char *funcname,
|
|||||||
if (filehandle)
|
if (filehandle)
|
||||||
*filehandle = lib_handle;
|
*filehandle = lib_handle;
|
||||||
|
|
||||||
/*
|
/* Look up the function within the library. */
|
||||||
* Look up the function within the library. According to POSIX dlsym()
|
retval = (PGFunction) dlsym(lib_handle, funcname);
|
||||||
* should declare its second argument as "const char *", but older
|
|
||||||
* platforms might not, so for the time being we just cast away const.
|
|
||||||
*/
|
|
||||||
retval = (PGFunction) dlsym(lib_handle, (char *) funcname);
|
|
||||||
|
|
||||||
if (retval == NULL && signalNotFound)
|
if (retval == NULL && signalNotFound)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@@ -174,8 +170,7 @@ load_file(const char *filename, bool restricted)
|
|||||||
PGFunction
|
PGFunction
|
||||||
lookup_external_function(void *filehandle, const char *funcname)
|
lookup_external_function(void *filehandle, const char *funcname)
|
||||||
{
|
{
|
||||||
/* as above, cast away const for the time being */
|
return (PGFunction) dlsym(filehandle, funcname);
|
||||||
return (PGFunction) dlsym(filehandle, (char *) funcname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user