File: nested.c

package info (click to toggle)
boxfort 0.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 508 kB
  • sloc: ansic: 3,664; asm: 225; sh: 18; makefile: 4; python: 3
file content (36 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>

#include "boxfort.h"

#define _assert(Cond) do { if (!(Cond)) abort(); } while (0)

#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#else
# define EXPORT
#endif

int second(void)
{
    printf("I am a nested worker!\n");
    fflush(stdout);
    return 0;
}

int first(void)
{
    printf("I am a worker!\n");
    fflush(stdout);

    _assert(!bxf_run(second));
    return 0;
}

EXPORT int main(void)
{
    _assert(!bxf_run(first));
    return 0;
}