mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2026-06-17 22:32:06 +00:00
Add a basic entry point to allow the nexe to link
This commit is contained in:
@@ -7,12 +7,13 @@ include $(NACL_SDK_ROOT)/tools/common.mk
|
|||||||
# Include Moonlight-Common-C makefile
|
# Include Moonlight-Common-C makefile
|
||||||
include common-c.mk
|
include common-c.mk
|
||||||
|
|
||||||
LIBS = ppapi pthread
|
LIBS = ppapi ppapi_cpp pthread nacl_io
|
||||||
|
|
||||||
CFLAGS = -Wall -Wno-missing-braces
|
CFLAGS = -Wall -Wno-missing-braces
|
||||||
SOURCES = \
|
SOURCES = \
|
||||||
$(COMMON_C_SOURCE) \
|
$(COMMON_C_SOURCE) \
|
||||||
libchelper.c \
|
libchelper.c \
|
||||||
|
main.cpp \
|
||||||
|
|
||||||
# Build rules generated by macros from common.mk:
|
# Build rules generated by macros from common.mk:
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user