Mercurial > mxe-octave
annotate src/libgcrypt-test.c @ 7251:e3bf1ceb1511 default tip @
Mesa 3D: Fix building for Linux without libdrm.
* src/mesa-1-libdrm.patch: Add new patch.
* dist-files.mk: Add new file to list.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Wed, 12 Jun 2024 20:54:42 +0200 |
parents | 3a37e58eab36 |
children |
rev | line source |
---|---|
2442
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
1 /* |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
2 * This file is part of MXE. |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
3 * See index.html for further information. |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
4 */ |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
5 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
6 #include <stdio.h> |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
7 #include <gcrypt.h> |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
8 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
9 int main(int argc, char *argv[]) |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
10 { |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
11 (void)argc; |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
12 (void)argv; |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
13 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
14 if (!gcry_check_version (GCRYPT_VERSION)) { |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
15 fputs ("libgcrypt version mismatch\n", stderr); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
16 exit (2); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
17 } |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
18 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
19 gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
20 gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
21 gcry_control (GCRYCTL_RESUME_SECMEM_WARN); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
22 gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
23 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
24 if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) { |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
25 fputs ("libgcrypt has not been initialized\n", stderr); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
26 abort (); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
27 } |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
28 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
29 printf("gcrypt version: %s", GCRYPT_VERSION ); |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
30 |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
31 return 0; |
3a37e58eab36
package libgcrypt: add test program and prefixed libgcrypt-config
Tony Theodore <tonyt@logyst.com>
parents:
diff
changeset
|
32 } |