hi..
i have an external library that i need to adapt for arduino.
one of the issues i have is that it has several sources files based on includes.
for example
_WIN32 is part of the compiler, but it i'm compiling for arduino
stpncpy.h header file is actualy located in another library
so 2 questions here.
how do i undef _WIN32 outside the source code (i'm assumign i would need to use undef in my own code
assuming i do manage to undef it.
how is it expected to actually work? i mean there is still a call to stpncpy function in this code but it would fail without a header file ?
so is there a way to say that for this source file?
btw a similar issue is for all those arrays, while in normal c they would work
but for parshahchar array for example, alll those strings would need to written with PSTR to save space on ram.
so how i can alter this header file to be flexible and compilable for both normal pc and arudino?
#include <string.h>
#include <stdio.h>
#include "hebrewcalendar.h"
#include "hdateformat.h"
#ifdef _WIN32
#include <stpncpy.h>
#endif
const char* hchar[]={ "׆", "א", "ב", "ג", "ד", "ה", "ו", "ז", "ח", "ט", "י", "כ", "ל", "מ", "נ", "ס", "ע", "פ", "צ", "ק", "ר", "ש", "ת", "״", "׳"};
const char* hmonth[]={ "אדר א׳", "ניסן", "אייר", "סיון", "תמוז", "אב", "אלול", "תשרי", "חשון", "כסלו", "טבת", "שבט", "אדר", "אדר ב׳"};
const char* hwday[]={ "שביעי", "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"};
const char* parshahchar[]={"\0", "בראשית", "נח", "לך לך", "וירא", "חיי שרה", "תולדות", "ויצא", "וישלח", "וישב", "מקץ", "ויגש", "ויחי", "שמות", "וארא", "בא", "בשלח", "יתרו", "משפטים", "תרומה", "תצוה", "כי תשא", "ויקהל", "פקודי", "ויקרא", "צו", "שמיני", "תזריע", "מצורע", "אחרי מות", "קדושים", "אמור", "בהר", "בחוקותי", "במדבר", "נשא", "בהעלותך", "שלח", "קרח", "חקת", "בלק", "פינחס", "מטות", "מסעי", "דברים", "ואתחנן", "עקב", "ראה", "שופטים", "כי תצא", "כי תבוא", "נצבים", "וילך", "האזינו", "וזאת הברכה", "ויקהל - פקודי", "תזריע - מצורע", "אחרי מות - קדושים", "בהר - בחוקותי", "חקת - בלק", "מטות - מסעי", "נצבים - וילך"};