Add __FreeBSD__ where needed to properly compile on FreeBSD + fix for Windows
This commit is contained in:
parent
9e43beec1a
commit
f449a65457
|
@ -34,7 +34,7 @@
|
||||||
#include <wx/numformatter.h>
|
#include <wx/numformatter.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
#include "CubicSDR.xpm"
|
#include "CubicSDR.xpm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ std::vector<std::string> str_explode(const std::string &seperator, const std::st
|
||||||
AppFrame::AppFrame() :
|
AppFrame::AppFrame() :
|
||||||
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(nullptr) {
|
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(nullptr) {
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
SetIcon(wxICON(cubicsdr));
|
SetIcon(wxICON(cubicsdr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CUBICSDR_TITLE "" CUBICSDR_BUILD_TITLE
|
#define CUBICSDR_TITLE "" CUBICSDR_BUILD_TITLE
|
||||||
|
|
||||||
#ifndef __BYTE_ORDER
|
#ifndef __BYTE_ORDER
|
||||||
|
@ -16,7 +20,11 @@
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <machine/endian.h>
|
#include <machine/endian.h>
|
||||||
#else
|
#else
|
||||||
#include <endian.h>
|
#ifdef __FreeBSD__
|
||||||
|
#include <sys/endian.h>
|
||||||
|
#else
|
||||||
|
#include <endian.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,4 +70,4 @@ const char filePathSeparator =
|
||||||
|
|
||||||
//The maximum number of listed sample rates for a device, to be able to handle
|
//The maximum number of listed sample rates for a device, to be able to handle
|
||||||
//devices returning an insane amount because they have quasi-continuous ranges (UHD...)
|
//devices returning an insane amount because they have quasi-continuous ranges (UHD...)
|
||||||
#define DEVICE_SAMPLE_RATES_MAX_NB 25
|
#define DEVICE_SAMPLE_RATES_MAX_NB 25
|
||||||
|
|
|
@ -83,7 +83,7 @@ void DemodLabelDialog::OnChar(wxKeyEvent& event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
dialogText->OnChar(event);
|
dialogText->OnChar(event);
|
||||||
event.Skip();
|
event.Skip();
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -218,7 +218,7 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
|
||||||
|
|
||||||
if (allowed.find_first_of(c) != std::string::npos || c == WXK_DELETE || c == WXK_BACK || c == WXK_NUMPAD_DECIMAL
|
if (allowed.find_first_of(c) != std::string::npos || c == WXK_DELETE || c == WXK_BACK || c == WXK_NUMPAD_DECIMAL
|
||||||
|| (c >= WXK_NUMPAD0 && c <= WXK_NUMPAD9)) {
|
|| (c >= WXK_NUMPAD0 && c <= WXK_NUMPAD9)) {
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
dialogText->OnChar(event);
|
dialogText->OnChar(event);
|
||||||
event.Skip();
|
event.Skip();
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <OpenGL/OpenGL.h>
|
#include <OpenGL/OpenGL.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ void initGLExtensions() {
|
||||||
CGLSetParameter (CGLGetCurrentContext(), kCGLCPSwapInterval, &interval);
|
CGLSetParameter (CGLGetCurrentContext(), kCGLCPSwapInterval, &interval);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
dlopen("libglx.so",RTLD_LAZY);
|
dlopen("libglx.so",RTLD_LAZY);
|
||||||
|
|
||||||
void (*glxSwapIntervalEXTFunc) (Display *dpy, GLXDrawable drawable, int interval) = 0;
|
void (*glxSwapIntervalEXTFunc) (Display *dpy, GLXDrawable drawable, int interval) = 0;
|
||||||
|
|
|
@ -30,7 +30,7 @@ void MouseTracker::OnMouseMoved(wxMouseEvent& event) {
|
||||||
|
|
||||||
if (isMouseDown || isMouseRightDown) {
|
if (isMouseDown || isMouseRightDown) {
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
#ifndef __linux__
|
#if !defined(__linux__) && !defined(__FreeBSD__)
|
||||||
if (horizDragLock && vertDragLock) {
|
if (horizDragLock && vertDragLock) {
|
||||||
target->WarpPointer(originMouseX * ClientSize.x, (1.0 - originMouseY) * ClientSize.y);
|
target->WarpPointer(originMouseX * ClientSize.x, (1.0 - originMouseY) * ClientSize.y);
|
||||||
mouseX = originMouseX;
|
mouseX = originMouseX;
|
||||||
|
|
Loading…
Reference in New Issue