Skip to content

Instantly share code, notes, and snippets.

BFD: /Users/amos/Dev/tests/mingw-debug-tests/backtrace.dylib: unknown load command 0x2a
BFD: /Users/amos/Dev/tests/mingw-debug-tests/backtrace.dylib: unknown load command 0x29
BFD: /Users/amos/Dev/tests/mingw-debug-tests/backtrace.dylib: unknown load command 0x2b
Successfully read 11802 symbols (/Users/amos/Dev/tests/mingw-debug-tests/backtrace.dylib)
>> Looking for line/no of symbol backtrace_signal_handler
module base = 0x101753000, address = 0x101753ab3, offset = 0xab3, symbol addr = 0x101753a60
Looking at 0x9e0 (3209876 bytes)
Looking at 0x310474 (582 bytes)
$ ./otest
[fancy backtrace]
0 backtrace_provoke (at /home/amos/Dev/tests/backtrace-universal/backtrace.c:588)
1 BacktraceHandler printBacktrace_impl() in obacktrace (at /home/amos/Dev/tests/backtrace-universal/obacktrace.ooc:80)
2 BacktraceHandler printBacktrace() in obacktrace (at /home/amos/Dev/tests/backtrace-universal/obacktrace.ooc:97)
3 App run_impl() in otest (at /home/amos/Dev/tests/backtrace-universal/otest.ooc:40)
4 App run() in otest (at /home/amos/Dev/tests/backtrace-universal/otest.ooc:55)
5 main (at /home/amos/Dev/tests/backtrace-universal/otest.ooc:1)
6 libc_start_main() in (at /build/eglibc-MUWt1e/eglibc-2.17/csu/libc-start.c:294)
7 _start (at (null):0)
@nddrylliog
nddrylliog / 32configure.sh
Last active December 21, 2015 19:39
Linux / Ubuntu 32-bit and 64-bit build / configure scripts
#!/bin/bash
export PREFIX="/home/amos/Dev/prefix32"
export CPPFLAGS="-I${PREFIX}/include"
export CFLAGS="-m32"
export CXXFLAGS="-m32"
export LDFLAGS="-m32 -L${PREFIX}/lib"
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
"$@" --prefix=${PREFIX}
@nddrylliog
nddrylliog / glew.diff
Last active December 21, 2015 18:39
glew diff for Win32
diff --git a/Makefile b/Makefile
index e6f08a7..a3fd901 100644
--- a/Makefile
+++ b/Makefile
@@ -134,7 +134,7 @@ glew.pc: glew.pc.in
-e "s|@includedir@|$(INCDIR)|g" \
-e "s|@version@|$(GLEW_VERSION)|g" \
-e "s|@cflags@||g" \
- -e "s|@libname@|GLEW|g" \
+ -e "s|@libname@|glew32|g" \
@nddrylliog
nddrylliog / after
Last active December 21, 2015 12:49
Final score = -97952
\o/ Found fDecl for pton, it's static Inet pton(Int, CString, Pointer) -> Int
** [refScore = -97952] Got suggestion static Inet pton(Int, CString, Pointer) -> Int for Inet pton(type, ip, ai&)
Regular arg consumes one.
Regular arg consumes one.
Regular arg consumes one.
matchesArg, score is now 256
typeScore for Int vs Int == 1024 for call Inet pton(type, ip, ai&) (signed int vs signed int) [0x2b2e660 vs 0x2b2e660]
typeScore for String vs CString == -100000 for call Inet pton(type, ip, ai&) (String vs char*) [0x2c22980 vs 0x2cb8d48]
typeScore for InAddr* vs Pointer == 512 for call Inet pton(type, ip, ai&) (struct in_addr* vs void*) [0x2df0ee0 vs 0x2c32550]
@nddrylliog
nddrylliog / fsync-emulation.patch
Created August 6, 2013 17:46
Patches to make gdbm compile on MinGW/MSYS
diff --git a/src/systems.h b/src/systems.h
index c83cd9c..f194318 100644
--- a/src/systems.h
+++ b/src/systems.h
@@ -70,6 +70,13 @@
# define STDERR_FILENO 2
#endif
+/* fsync emulation for MinGW */
+#ifdef __MINGW32__
@nddrylliog
nddrylliog / winbrew.md
Last active December 20, 2015 16:19
Winbrew
@nddrylliog
nddrylliog / stuff-to-put-on-ooc-lang.org.md
Created August 5, 2013 20:24
Stuff to put on ooc-lang.org

Stuff

  • Code samples
  • Get started in 5 minutes on: OSX, Linux, Windows (brew, etc.)
  • Using sam, using third-party libs, making your own lib
  • The llama seal of quality
  • Find your marks from C / Java / Python / Ruby ?
  • Link to / integrate: "the ooc language"?
  • Links to talks/slides
@nddrylliog
nddrylliog / writing-exercise.md
Created July 10, 2013 22:31
Writing exercise in my 2013-07-11 750 words :)

In fact, I no longer think of English as a foreign language, it has become second nature although I still struggle from time to time to express some thoughts in particular. The same happens with French though, I tend to forget words, although I know they exist. When I was younger and I wrote things, for example for the French class at my high school, I had a tendency to want to integrate complex words nowhere and everywhere (is that even and expression?) - I'd put a whole slew of it, and then some. I like slew now.

And the result was that what I wrote was non-homogenous. Just as the music I wrote back then. Maybe it was more creative because more came out of it, but at the same time it was less "regular" than it is now. Even though the 750 words I write each day are mostly shit, I do write them, and it is becoming an habit. Do you ever become good at writing? Maybe I need exercises.

Let's write the phrase "Maybe I need exercises" in a few different ways.

"Maybe I need exercises"

"Maybe writing is a talent

@nddrylliog
nddrylliog / libfreetype2-android.md
Created June 28, 2013 20:28
Compiling libfreetype2 for Android

There's a repo to make it easier to use Freetype on Android: cdave1/freetype2-android.

With the ooc conventions for Android packages, jni/freetype2 will be created for ooc-freetype2, and it expects the freetype2 C library to be put in jni/c_freetype2, so let's do just that.

  • Clone freetype2-android
  • cd freetype2-android/Android/jni
  • ndk-build freetype2-static

After that, there is freetype2-android/Android/obj/local/armeabi/libfreetype2-static.a. The headers are in freetype2-android/include/. All we need is to prepare our nice folder like every other C lib we cross-compiled. The folder structure is something like that: