mirror of
https://github.com/darlinghq/darling.git
synced 2024-12-02 09:26:56 +00:00
5f96f6c7fb
This makes it easy to add the folder to PATH and run commands
26 lines
263 B
Bash
Executable File
26 lines
263 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cfile=/tmp/sizeof.$$.cpp
|
|
include="$1"
|
|
struct="$2"
|
|
|
|
cat > $cfile <<END
|
|
#include <stdio.h>
|
|
#include <$include>
|
|
|
|
int main()
|
|
{
|
|
printf("sizeof($struct)=%d\n", sizeof($struct));
|
|
return 0;
|
|
}
|
|
|
|
END
|
|
|
|
g++ -w $cfile -o $cfile.bin
|
|
$cfile.bin
|
|
|
|
rm $cfile*
|
|
|