NAG Library Manual, Mark 28.5
Interfaces:  FL   CL   CPP   AD 

NAG CL Interface Introduction
Example description
/* nag_info_impl_details (a00aac) Example Program.
 *
 * Copyright 2022 Numerical Algorithms Group.
 *
 * Mark 28.5, 2022.
 */

#include <nag.h>
#include <stdio.h>
#include <string.h>

int main(void) {
  Integer exit_status = 0;
  unsigned int sizeofpointer = sizeof(void *);
  unsigned int sizeofInteger = sizeof(Integer);
  unsigned int sp, si;

  /* Get the expected sizes of pointers and integers (in bytes) */
  a00aay(&sp, &si);

  printf("nag_info_impl_details (a00aac) Example Program Results\n\n");

  /* Check that the pointer and integer sizes are as expected, and
     issue a warning if not */
  if (sp != sizeofpointer || si != sizeofInteger) {
    printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
           "~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
    if (sp != sizeofpointer)
      printf(" Incorrect value of sizeof(void *)\n"
             "  expected %u, returned %u.\n\n",
             sp, sizeofpointer);
    if (si != sizeofInteger)
      printf(" Incorrect value of sizeof(Integer)\n"
             "  expected %u, returned %u.\n\n",
             si, sizeofInteger);
    printf(" The NAG Library header files are "
           "incompatible with the NAG Library.\n\n");
    printf(" Please check the location of your "
           "NAG Library include files.\n\n");
    printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
           "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n");
    exit_status = 1;
  }

  nag_info_impl_details();

  return exit_status;
}