Compare commits
2 commits
db677241b0
...
cf5ed43812
Author | SHA1 | Date | |
---|---|---|---|
cf5ed43812 | |||
f801a68eb1 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -52,3 +52,5 @@ Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
# Testing files
|
||||||
|
test-*.c
|
||||||
|
|
34
pc-outro.c
Normal file
34
pc-outro.c
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "portaudio.h"
|
||||||
|
|
||||||
|
|
||||||
|
void shutdown(int os);
|
||||||
|
|
||||||
|
void main (void){
|
||||||
|
int os;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
os = 1;
|
||||||
|
#elif TARGET_OS_MAC
|
||||||
|
os = 2
|
||||||
|
#elif __linux__
|
||||||
|
os = 3;
|
||||||
|
#elif BSD
|
||||||
|
os = 4;
|
||||||
|
#else
|
||||||
|
os = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf("%d", os);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void shutdown(int os){
|
||||||
|
switch(os){
|
||||||
|
case 3:
|
||||||
|
// TODO: check init system; https://unix.stackexchange.com/questions/18209/detect-init-system-using-the-shell
|
||||||
|
system("shutdown -P now");
|
||||||
|
default:
|
||||||
|
printf("Error: Could not determine OS");
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue