Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up some, added 'dlfcn-win32' library.

  • Loading branch information...
commit 7eec281dc736a4d8f7ade431d7f701b01c76dd90 1 parent 1948649
Adrian orangea authored
2  .gitignore
View
@@ -16,4 +16,4 @@ gc-test
._*
.DS_Store
*.so
-*.a
+potion.a
2  INSTALL.md
View
@@ -1,4 +1,4 @@
-## ~ building potion ~
+# ~ building potion ~
Normally,
8 Makefile
View
@@ -11,7 +11,7 @@ DOCHTML = ${DOC:.textile=.html}
PREFIX = /usr/local
CC = gcc
-CFLAGS = -Wall -fno-strict-aliasing -Wno-return-type -D_GNU_SOURCE -rdynamic
+CFLAGS = -Wall -fno-strict-aliasing -Wno-return-type -D_GNU_SOURCE
AR ?= ar
DEBUG ?= 0
ECHO = /bin/echo
@@ -29,10 +29,14 @@ VERSION = `./tools/config.sh ${CC} version`
DATE = `date +%Y-%m-%d`
REVISION = `git rev-list HEAD | wc -l | sed "s/ //g"`
COMMIT = `git rev-list HEAD -1 --abbrev=7 --abbrev-commit`
-
RELEASE ?= ${VERSION}.${REVISION}
PKG := "potion-${RELEASE}"
+MINGW = `./tools/config.sh ${CC} mingw`
+CFLAGS += ${if ${seq ${MINGW},0},-rdynamic}
+INCS += ${if ${seq ${MINGW},1},-Itools/dlfcn-win32/include}
+LIBS += ${if ${seq ${MINGW},1},-Ltools/dlfcn-win32/lib}
+
all: pn
+${MAKE} -s usage
12 lib/readline/readline.c
View
@@ -7,13 +7,11 @@
PN pn_readline(Potion *P, PN cl, PN self, PN start) {
char *line = readline(PN_STR_PTR(start));
PN r;
- if (line) {
- add_history(line);
- r = potion_str(P, line);
- free(line);
- return r;
- }
- return PN_NIL;
+ if (line == NULL) return PN_NIL;
+ add_history(line);
+ r = potion_str(P, line);
+ free(line);
+ return r;
}
void Potion_Init_readline(Potion *P) {
45 tools/dlfcn-win32/include/dlfcn.h
View
@@ -0,0 +1,45 @@
+/*
+ * dlfcn-win32
+ * Copyright (c) 2007 Ramiro Polla
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DLFCN_H
+#define DLFCN_H
+
+/* POSIX says these are implementation-defined.
+ * To simplify use with Windows API, we treat them the same way.
+ */
+
+#define RTLD_LAZY 0
+#define RTLD_NOW 0
+
+#define RTLD_GLOBAL (1 << 1)
+#define RTLD_LOCAL (1 << 2)
+
+/* These two were added in The Open Group Base Specifications Issue 6.
+ * Note: All other RTLD_* flags in any dlfcn.h are not standard compliant.
+ */
+
+#define RTLD_DEFAULT 0
+#define RTLD_NEXT 0
+
+void *dlopen ( const char *file, int mode );
+int dlclose( void *handle );
+void *dlsym ( void *handle, const char *name );
+char *dlerror( void );
+
+#endif /* DLFCN_H */
BIN  tools/dlfcn-win32/lib/libdl.a
View
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.