mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-12-01 22:16:27 +00:00
29f66a98cd
* correct shell utilities: params differ on mac, remove debug print, + correct a bug on windows * Simplify the example, libz is also needed by libgd * Framework function: simplify code gathering deps, collect_libs public * Correct configure-make: get all lib files, also built with bazel and pass them in LDFLAGS; correct the linking paths (add prefix) * Make maximum line length for shell = 80 * Improve comments to the _InputFiles provider
30 lines
627 B
C
30 lines
627 B
C
/* Copied from https://github.com/libgd/libgd/blob/master/examples/arc.c for test */
|
|
/* $Id$ */
|
|
#include "gd.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main()
|
|
{
|
|
gdImagePtr im;
|
|
FILE *fp;
|
|
int cor_rad = 60;
|
|
im = gdImageCreateTrueColor(400, 400);
|
|
gdImageFilledRectangle(im, 0, 0, 399, 399, 0x00FFFFFF);
|
|
|
|
gdImageFilledArc (im, cor_rad, 399 - cor_rad, cor_rad *2, cor_rad *2, 90, 180, 0x0, gdPie);
|
|
|
|
fp = fopen("b.png", "wb");
|
|
if (!fp) {
|
|
fprintf(stderr, "Can't save png image.\n");
|
|
gdImageDestroy(im);
|
|
return 1;
|
|
}
|
|
gdImagePng(im, fp);
|
|
fclose(fp);
|
|
|
|
gdImageDestroy(im);
|
|
|
|
fprintf(stdout, "Success.\n");
|
|
return 0;
|
|
} |