While ago I was working on Lua based implementation of the scripting library. One of the requirements was a total control of output and error messages, to allow it's automatic handling. One of the issues I've faced is that some output was going to stdout even if there is redefined print Lua function.
I thought about two quick solutions:
- redirect standard streams;
- redefine printf and it's adjacent functions.
Since standard streams, both stdout and stderr, in my case were already redefined (for remote debugging purposes), I didn't had much to choose from.
Looking into Lua 5.1 sources, I've found that stdout was simply hard-coded in some places. During up-streaming this patch to Lua 5.2 surprisingly most of the hard-coded stream names went away, and it looks like it would be possible to use redefined print without losing anything. I haven't tested this though. Following just works for Lua 5.1.x and above.
Showing posts with label library. Show all posts
Showing posts with label library. Show all posts
2012-08-10
2009-09-14
Removing MinGW dll dependencies
libgcc_s_dw2-1.dll
Passing -static-libgcc will remove this dependency for all languages other than C.
Note: C++ exceptions depends on this option.
mingwm10.dll
Remove -mthreads option from your makefile.
Note: Multithreading and C++ exceptions depends on this option.
Passing -static-libgcc will remove this dependency for all languages other than C.
Note: C++ exceptions depends on this option.
mingwm10.dll
Remove -mthreads option from your makefile.
Note: Multithreading and C++ exceptions depends on this option.
2009-05-21
libpqtypes
In recent post I've posted part of my library, that deals with PostgreSQL data in binary format. Today, googling for some hints for implementing binary timestamps in double format I've found a reliable library, libpqtypes, which is doing exactly the same as mine (actually more), except it's purpose is PostgreSQL only.
Don't know if it's terrible news or not, as I could adapt my code while using this library and win a lot of time. This is one of the reasons why extensive googling is required before each project.
Don't know if it's terrible news or not, as I could adapt my code while using this library and win a lot of time. This is one of the reasons why extensive googling is required before each project.
2009-04-12
Gettext compilation on MSys
Trying to build gettext library on MSys I've got some errors related to pthread. Included readme states you need to have Cygwin for that. For those, who prefer MSys over Cygwin here goes a quick fix:
Remove tests target from gettext-runtime/Makefile and gettext-tools/Makefile.
./configureAdd -lpthread to LIBS section in gettext-runtime/src/Makefile and gettext-tools/src/Makefile.
Remove tests target from gettext-runtime/Makefile and gettext-tools/Makefile.
make; make installBe happy.
2009-04-07
Libiconv compilation sed on msys error
Trying to build libiconv library under msys environment, I've got sed related errors:
sed: -e expression #2, char 32: Extra characters after commandFortunately, I've found a solution in the internet:
diff -ur tmp/libiconv-1.12/windows/windres-options src/libiconv-1.12/windows/windres-options
--- tmp/libiconv-1.12/windows/windres-options 2007-05-27 19:42:10 +0100
+++ src/libiconv-1.12/windows/windres-options 2008-05-28 13:41:03 +0100
@@ -14,20 +14,29 @@
fi
version="$1" # something like 2.0 or 2.17 or 2.17.3 or 2.17.3-pre3
-sed_extract_major='/^[0-9]/{s/^([0-9]*).*/1/p;q}
+sed_extract_major='
+/^[0-9]/{
+ s/^([0-9]*).*/1/p
+ q
+}
a
0
-q
'
-sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]([0-9]*).*/1/p;q}
+sed_extract_minor='
+/^[0-9][0-9]*[.][0-9]/{
+ s/^[0-9]*[.]([0-9]*).*/1/p
+ q
+}
a
0
-q
'
-sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]([0-9]*).*/1/p;q}
+sed_extract_subminor='
+/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{
+ s/^[0-9]*[.][0-9]*[.]([0-9]*).*/1/p
+ q
+}
a
0
-q
'
{
Credit goes to Keith Marshall.
2009-04-01
Create MinGW library from dll
For this, you need pexports tool from mingw-utils.
pexports library.dll > library.def dlltool -D library.dll -d library.def -l library.dll.aNote, that if dll was built by different environment than gcc, this probably will not work because of the naming conventions. If this the case, read here.
Subscribe to:
Posts (Atom)