This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(sb-alien:load-shared-object "unwind.dll") | |
(sb-alien:define-alien-routine | |
("catches_fn" catches-fn) | |
sb-alien:void | |
(fn (* T))) | |
(defun sap-to-callable (ptr) | |
(sb-alien:sap-alien | |
(sb-alien:alien-sap ptr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ -O0 -shared -o unwind.dll unwind.cxx | |
// OR | |
// cl.exe /nologo /Od /MD /EHa /LD /Fe:unwind.dll unwind.cxx | |
#include <iostream> | |
#include <exception> | |
#include <windows.h> | |
class Foo | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(sb-alien:load-shared-object "sehlib.dll") | |
(sb-alien:define-alien-routine | |
("catches_fn" catches-fn) | |
sb-alien:void) | |
(defun test-seh () | |
(handler-case | |
(progn (catches-fn) | |
(format *error-output* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cl.exe /nologo /clr /Od /MD /EHac /LD /Fe:sehlib.dll sehlib_net.cxx | |
using namespace System; | |
#include <iostream> | |
void throws_fn() | |
{ | |
std::cerr << ".NET throws exception" << std::endl; | |
throw gcnew Exception(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ -O0 -shared -o sehlib.dll sehlib.cxx | |
// OR | |
// cl.exe /nologo /Od /MD /EHac /LD /Fe:sehlib.dll sehlib.cxx | |
#include <iostream> | |
#include <exception> | |
void throws_fn() | |
{ | |
std::cerr << "C++ throws exception" << std::endl; | |
throw std::exception(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
DATE_START=`date +%Y-%m-01` | |
DATE_END=`date +%Y-%m-%d` | |
USER_NAME=`git config user.name` | |
REPO_DIR=`realpath ./` | |
BRANCH_NAME='origin/master' | |
if [ -t 0 -a -t 1 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __COM_UTILS_HPP__ | |
#define __COM_UTILS_HPP__ | |
#include <oleidl.h> | |
template<class T> | |
class ComPtr | |
{ | |
public: | |
ComPtr() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build like e.g. | |
// cl.exe /nologo /O2 /I../ffmpeg-3.2.2-win64-lgpl/include /I../SDL2-2.0.5/include /MT ffexample.c SDL2.lib avcodec.lib avdevice.lib avformat.lib avutil.lib swresample.lib swscale.lib /link /libpath:../SDL2-2.0.5/lib/x64 /libpath:../ffmpeg-3.2.2-win64-lgpl/lib | |
#define __STDC_CONSTANT_MACROS | |
#ifndef UNICODE | |
#define UNICODE | |
#endif | |
#ifndef _UNICODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define __STDC_CONSTANT_MACROS | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <windows.h> | |
#include <stdio.h> | |
#ifdef __cplusplus | |
extern "C" | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define __STDC_CONSTANT_MACROS | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <windows.h> | |
#include <stdio.h> | |
extern "C" | |
{ | |
#include <libavfilter/avfilter.h> |