Skip to content

Commit

Permalink
Tightened target architecture checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Mar 23, 2024
1 parent b5fa6df commit 8c15dba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/diwa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
# include <bootloader_random.h>
#endif

#if !defined(ARDUINO)
#if defined(__GNUC__) || defined(__GNUG__) || defined(__clang__) || defined(_MSC_VER)
# include <cstring>
#endif

#include <diwa.h>
#include <diwa_conv.h>

#ifndef ARDUINO
#if (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__) || defined(_MSC_VER)) && !defined(PSP)

static inline void writeToStream(std::ofstream& stream, const uint8_t* data, size_t size) {
for(size_t i = 0; i < size; i++)
Expand Down Expand Up @@ -375,7 +375,7 @@ DiwaError Diwa::saveToFile(File annFile) {
return NO_ERROR;
}

#else
#elif (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__) || defined(_MSC_VER)) && !defined(PSP)

DiwaError Diwa::loadFromFile(std::ifstream& annFile) {
if(!annFile.is_open())
Expand Down
10 changes: 6 additions & 4 deletions src/diwa.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@
# else
# include <SD.h>
# endif
#else
#elif (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__) || defined(_MSC_VER)) && !defined(PSP)
# include <fstream>
# include <stdint.h>
# include <math.h>
#elif defined(PSP)
# include <pspmath.h>
#endif

#include <diwa_activations.h>
#include <math.h>
#include <stdint.h>

/**
* @enum DiwaError
Expand Down Expand Up @@ -243,7 +245,7 @@ class Diwa final {
*/
DiwaError saveToFile(File annFile);

#else
#elif (defined(__GNUC__) || defined(__GNUG__) || defined(__clang__) || defined(_MSC_VER)) && !defined(PSP)

/**
* @brief Load neural network model from file in non-Arduino environment.
Expand Down
2 changes: 2 additions & 0 deletions src/diwa_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#ifndef DIWA_UTIL_H
#define DIWA_UTIL_H

#include <stdint.h>

/** @cond */
typedef union {
double d;
Expand Down

0 comments on commit 8c15dba

Please sign in to comment.