Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /MLRISC/trunk/vararg-ccall/tv.c
ViewVC logotype

View of /MLRISC/trunk/vararg-ccall/tv.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3062 - (download) (as text) (annotate)
Wed Jun 4 06:59:52 2008 UTC (11 years, 1 month ago) by mrainey
File size: 312 byte(s)
  Refactored varargs into a library.
#include <stdio.h>
#include <dlfcn.h>

int main ()
{
  void* handle = dlopen("./vararg", RTLD_LOCAL | RTLD_LAZY);
  
  if (!handle) {
    printf ("fail\n");
    return 1;
  }

  int (*vararg)(void*, void*, int);
  vararg = dlsym(handle, "vararg");
  if (!vararg)
    return 1;

  vararg(0, 0, 0);

  return 0;
}

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0