patch for darwin/macosx-publicbeta

Started by Peter Biermanover 25 years ago3 messagespatches
Jump to latest
#1Peter Bierman
pmb@squee.sfgoth.com

Follows is a tiny patch to make top of tree compile up to the IPC section
on Mac OS X Public Beta. I have not yet chased down what will be needed for
IPC, but this patch corrects a incorrect return type in the dyloader code
to match how the qnx and hpux files use PGFunction. This also fixes the
Makefile to use a tab instead of 8 spaces. (please make sure it is patched
as a tab!)

Index: src/makefiles/Makefile.darwin
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/makefiles/Makefile.darwin,v
retrieving revision 1.1
diff -u -r1.1 Makefile.darwin
--- src/makefiles/Makefile.darwin       2000/10/31 19:55:19     1.1
+++ src/makefiles/Makefile.darwin       2000/11/14 09:15:13
@@ -4,4 +4,4 @@
 CFLAGS_SL = -bundle -undefined suppress
 %.so: %.o
-        $(CC) $(CFLAGS) $(CFLAGS_SL) -o $@ $<
+       $(CC) $(CFLAGS) $(CFLAGS_SL) -o $@ $<
Index: src/backend/port/dynloader/darwin.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v
retrieving revision 1.2
diff -u -r1.2 darwin.c
--- src/backend/port/dynloader/darwin.c 2000/11/09 19:00:50     1.2
+++ src/backend/port/dynloader/darwin.c 2000/11/14 09:15:11
@@ -7,6 +7,9 @@
  */
 #include <mach-o/dyld.h>
+#include "c.h"
+#include "postgres_ext.h"
+#include "utils/palloc.h"
 #include "dynloader.h"

void *pg_dlopen(const char *filename)
@@ -25,7 +28,7 @@
return;
}

-PGFunction *pg_dlsym(void *handle, const char *funcname)
+PGFunction pg_dlsym(void *handle, const char *funcname)
 {
        NSSymbol symbol;
        char *symname = (char*)malloc(strlen(funcname)+2);
@@ -33,7 +36,7 @@
        sprintf(symname, "_%s", funcname);
        symbol = NSLookupAndBindSymbol(symname);
        free(symname);
-       return (PGFunction *) NSAddressOfSymbol(symbol);
+       return (PGFunction) NSAddressOfSymbol(symbol);
 }

const char *pg_dlerror(void)
eturn (PGFunction) NSAddressOfSymbol(symbol);
}

const char *pg_dlerror(void)

Since I am not subscribed to this list, please send replies to pmb@mac.com

-pmb

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Bierman (#1)
Re: patch for darwin/macosx-publicbeta

Peter Bierman writes:

Follows is a tiny patch to make top of tree compile up to the IPC section
on Mac OS X Public Beta.

Thanks.

I have not yet chased down what will be needed for IPC,

Essentially you'll need a newer kernel. Alternatively, look through
Bruce Hartzler's Oct 22 messages on pgsql-hackers. They contain some
additonal stop gap code until semaphore support is widely available.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Bierman (#1)
Re: patch for darwin/macosx-publicbeta

Sorry, looks like these have mostly been fixed. Please grab the current
snapshot and let us know. Thanks.

Follows is a tiny patch to make top of tree compile up to the IPC section
on Mac OS X Public Beta. I have not yet chased down what will be needed for
IPC, but this patch corrects a incorrect return type in the dyloader code
to match how the qnx and hpux files use PGFunction. This also fixes the
Makefile to use a tab instead of 8 spaces. (please make sure it is patched
as a tab!)

Index: src/makefiles/Makefile.darwin
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/makefiles/Makefile.darwin,v
retrieving revision 1.1
diff -u -r1.1 Makefile.darwin
--- src/makefiles/Makefile.darwin       2000/10/31 19:55:19     1.1
+++ src/makefiles/Makefile.darwin       2000/11/14 09:15:13
@@ -4,4 +4,4 @@
CFLAGS_SL = -bundle -undefined suppress
%.so: %.o
-        $(CC) $(CFLAGS) $(CFLAGS_SL) -o $@ $<
+       $(CC) $(CFLAGS) $(CFLAGS_SL) -o $@ $<
Index: src/backend/port/dynloader/darwin.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v
retrieving revision 1.2
diff -u -r1.2 darwin.c
--- src/backend/port/dynloader/darwin.c 2000/11/09 19:00:50     1.2
+++ src/backend/port/dynloader/darwin.c 2000/11/14 09:15:11
@@ -7,6 +7,9 @@
*/
#include <mach-o/dyld.h>
+#include "c.h"
+#include "postgres_ext.h"
+#include "utils/palloc.h"
#include "dynloader.h"

void *pg_dlopen(const char *filename)
@@ -25,7 +28,7 @@
return;
}

-PGFunction *pg_dlsym(void *handle, const char *funcname)
+PGFunction pg_dlsym(void *handle, const char *funcname)
{
NSSymbol symbol;
char *symname = (char*)malloc(strlen(funcname)+2);
@@ -33,7 +36,7 @@
sprintf(symname, "_%s", funcname);
symbol = NSLookupAndBindSymbol(symname);
free(symname);
-       return (PGFunction *) NSAddressOfSymbol(symbol);
+       return (PGFunction) NSAddressOfSymbol(symbol);
}

const char *pg_dlerror(void)
eturn (PGFunction) NSAddressOfSymbol(symbol);
}

const char *pg_dlerror(void)

Since I am not subscribed to this list, please send replies to pmb@mac.com

-pmb

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026