mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2026-03-21 17:20:57 +03:00
add stellarium emulation
This commit is contained in:
20
C-functions_overload.c
Normal file
20
C-functions_overload.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define FUNC(arg) _Generic(arg, uint16_t: funcu, int32_t: funci)(arg)
|
||||
|
||||
void funcu(uint16_t arg){
|
||||
printf("uint16_t: %u\n", arg);
|
||||
}
|
||||
|
||||
void funci(int32_t arg){
|
||||
printf("int32_t: %d\n", arg);
|
||||
}
|
||||
|
||||
int main(){
|
||||
uint16_t u = 32;
|
||||
int32_t i = -50333;
|
||||
FUNC(u);
|
||||
FUNC(i);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user