Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <string.h>
- #include <stdarg.h>
- #include <wchar.h>
- #define printf(format, args...) wprintf (L##format, ##args)
- #define _add_l(format) (L##format)
- typedef void* handle_type;
- typedef handle_type(*open_func)(const char*, const char*);
- typedef int(*printf_func)(handle_type, const char*, ...);
- typedef int(*wprintf_func)(handle_type, const wchar_t*, ...);
- wprintf_func Printf;
- int
- roprintf(const wchar_t *format, ...)
- {
- int ret;
- va_list ap;
- va_start(ap, format);
- ret = vfwprintf(stdout, _add_l(format), ap);
- va_end(ap);
- return (ret);
- }
- int main(int argc, char *argv[])
- {
- wchar_t *snafu = L"notação";
- char *foo = "foo";
- Printf = (wprintf_func)&roprintf;
- // Printf should do the same as printf
- printf("%ls\n",snafu);
- Printf("%ls\n",snafu);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement