Bläddra i källkod

Add C++ support

Add extern statement. Also fix the strlwr definition on Windows.
master
TheoryOfNekomata 1 år sedan
förälder
incheckning
c41eb2823f
3 ändrade filer med 12 tillägg och 4 borttagningar
  1. +1
    -1
      CMakeLists.txt
  2. +1
    -1
      midi-utils.c
  3. +10
    -2
      midi-utils.h

+ 1
- 1
CMakeLists.txt Visa fil

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.24)
project(midi_note_id_utils C)
project(midi_utils C)

set(CMAKE_C_STANDARD 11)



+ 1
- 1
midi-utils.c Visa fil

@@ -1,6 +1,6 @@
#include "midi-utils.h"

#if !defined __WIN32
#if !defined _WIN32
void _strlwr(char* dest) {
for (unsigned int i = 0; i < strlen(dest); i += 1) {
if ('A' <= dest[i] && dest[i] <= 'Z') {


+ 10
- 2
midi-utils.h Visa fil

@@ -11,8 +11,16 @@
#define MIDI_CC_SOSTENUTO 0x42u
#define MIDI_CC_UNACORDA 0x43u

char* MIDI_GetNoteName(unsigned char);
#if defined __cplusplus
extern "C" {
#endif

char *MIDI_GetNoteName(unsigned char);

unsigned char MIDI_GetNoteFromName(const char*);
unsigned char MIDI_GetNoteFromName(const char *);

#if defined __cplusplus
}
#endif

#endif

Laddar…
Avbryt
Spara