daily pastebin goal
17%
SHARE
TWEET

Compile the Beep() function into WebAssembly

a guest Jan 23rd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include "windows.h"
  3. #include <emscripten/bind.h>
  4. using namespace emscripten;
  5.  
  6. extern "C" {
  7.     void DoBeep(int x, int y) {
  8.         Beep(x, y);
  9.     }
  10.  
  11.     void _Z4Beepmm(int x, int y) {
  12.         std::cout << "\a" << std::endl;
  13.     }
  14. }
  15.  
  16. EMSCRIPTEN_BINDINGS(module) {
  17.     function("Beep", &DoBeep);
  18. }
  19.  
  20. int main() {
  21.     std::cout << "Loaded" << std::endl;
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top