mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 00:26:56 +00:00
Add a basic entry point to allow the nexe to link
This commit is contained in:
parent
0a04b8dba3
commit
364b8d6e9b
3
Makefile
3
Makefile
@ -7,12 +7,13 @@ include $(NACL_SDK_ROOT)/tools/common.mk
|
||||
# Include Moonlight-Common-C makefile
|
||||
include common-c.mk
|
||||
|
||||
LIBS = ppapi pthread
|
||||
LIBS = ppapi ppapi_cpp pthread nacl_io
|
||||
|
||||
CFLAGS = -Wall -Wno-missing-braces
|
||||
SOURCES = \
|
||||
$(COMMON_C_SOURCE) \
|
||||
libchelper.c \
|
||||
main.cpp \
|
||||
|
||||
# Build rules generated by macros from common.mk:
|
||||
|
||||
|
30
main.cpp
Normal file
30
main.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include "ppapi/cpp/instance.h"
|
||||
#include "ppapi/cpp/module.h"
|
||||
#include "ppapi/cpp/var.h"
|
||||
|
||||
#include "nacl_io/nacl_io.h"
|
||||
|
||||
class MoonlightInstance : public pp::Instance {
|
||||
public:
|
||||
explicit MoonlightInstance(PP_Instance instance) : pp::Instance(instance) {}
|
||||
virtual ~MoonlightInstance() {}
|
||||
};
|
||||
|
||||
class MoonlightModule : public pp::Module {
|
||||
public:
|
||||
MoonlightModule() : pp::Module() {}
|
||||
virtual ~MoonlightModule() {}
|
||||
|
||||
virtual pp::Instance* CreateInstance(PP_Instance instance) {
|
||||
return new MoonlightInstance(instance);
|
||||
}
|
||||
};
|
||||
|
||||
namespace pp {
|
||||
Module* CreateModule() {
|
||||
// Initialize nacl_io before entering moonlight-common-c for BSD sockets
|
||||
nacl_io_init();
|
||||
|
||||
return new MoonlightModule();
|
||||
}
|
||||
} // namespace pp
|
Loading…
x
Reference in New Issue
Block a user