e.g.
$ cat life.zig
export fn meaningoflife() i32 {
return 42;
}
$ ../zig-linux-x86_64-0.4.0+f8117a07/zig build-obj -target avr-freestanding life.zig
$ file life.o
life.o: ELF 32-bit LSB relocatable, Atmel AVR 8-bit, version 1 (SYSV), not stripped
$ cat life.h
#ifndef LIFE_H
#define LIFE_H
#include <stdint.h>
#ifdef __cplusplus
#define LIFE_EXTERN_C extern "C"
#else
#define LIFE_EXTERN_C
#endif
#if defined(_WIN32)
#define LIFE_EXPORT LIFE_EXTERN_C __declspec(dllimport)
#else
#define LIFE_EXPORT LIFE_EXTERN_C __attribute__((visibility ("default")))
#endif
LIFE_EXPORT int32_t meaningoflife(void);
#endif
e.g.
Windows is never going to support AVR: we shouldn't include the
defined(_WIN32)branch.