Skip to content

Commit db75f51

Browse files
committed
Add IS_STORAGE() macro
1 parent 5517f5b commit db75f51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cpp/gbc/src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int main(int argc, char** argv)
296296
{
297297
(void)argc;
298298

299-
if (strcmp(argv[2], "storage") == 0)
299+
if (IS_STORAGE())
300300
{
301301
/* GameBoy Color machine */
302302
machine = new gbc::Machine(romdata);

kvm_api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern void register_func(int, ...);
5151
**/
5252
#define IS_SANDBOXED_MAIN() (getenv("KVM_NAME") != (void*)0)
5353
#define IS_LINUX_MAIN() !IS_SANDBOXED_MAIN()
54-
54+
#define IS_STORAGE() (strcmp(getenv("KVM_TYPE"), "storage") == 0)
5555
/**
5656
* During the start of the program, one should register callback functions
5757
* that will handle different types of requests, like GET, POST etc.

0 commit comments

Comments
 (0)