From 96f5bed67cf3027b33c4bec426fb7833d9f5ab58 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Thu, 8 Jul 2010 00:57:10 +0000 Subject: abusing the svn repository to copy the code from GNU/Linux host and FreeBSD in virtualbox :) git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@54330 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfcdrom/cdr.h | 3 +++ plugins/dfcdrom/cdrcfg-0.1df/main.c | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/dfcdrom/cdr.h b/plugins/dfcdrom/cdr.h index fab260e5..5ebdbbc0 100644 --- a/plugins/dfcdrom/cdr.h +++ b/plugins/dfcdrom/cdr.h @@ -76,6 +76,9 @@ struct cdrom_msf { #ifdef __FreeBSD__ +#include +#include + #define DEV_DEF "/dev/acd0" #else diff --git a/plugins/dfcdrom/cdrcfg-0.1df/main.c b/plugins/dfcdrom/cdrcfg-0.1df/main.c index 0563eb70..2ab7c851 100644 --- a/plugins/dfcdrom/cdrcfg-0.1df/main.c +++ b/plugins/dfcdrom/cdrcfg-0.1df/main.c @@ -28,7 +28,6 @@ GtkWidget *MainWindow; // function to check if the device is a cdrom int is_cdrom(const char *device) { -#ifdef __linux__ struct stat st; int fd = -1; @@ -41,6 +40,7 @@ int is_cdrom(const char *device) { // try to open the device file descriptor if ((fd = open(device, O_RDONLY | O_NONBLOCK)) < 0) return 0; +#ifdef __linux__ // I need a method to check is a device is really a CD-ROM. // some problems/ideas are: // - different protocls (ide, scsi, old proprietary...) @@ -62,9 +62,9 @@ int is_cdrom(const char *device) { close(fd); return 0; } +#endif close(fd); -#endif // yes, it seems a CD drive! return 1; @@ -83,6 +83,7 @@ void fill_drives_list(GtkWidget *widget) { GtkListStore *store; GtkTreeIter iter; +#if defined (__linux__) static const char *cdrom_devices[] = { "/dev/cdrom", "/dev/cdrom0", @@ -107,6 +108,16 @@ void fill_drives_list(GtkWidget *widget) { "/dev/scd3", "/dev/optcd", NULL}; +#elif defined (__FreeBSD__) + static const char *cdrom_devices[] = { + "/dev/acd0", + "/dev/acd1", + "/dev/acd2", + "/dev/acd3", + NULL}; +#else + static const char *cdrom_devices[] = { NULL }; +#endif store = gtk_list_store_new(1, G_TYPE_STRING); -- cgit v1.2.3